From 10afb4f79299cae08344fd8245a7217ea49f712e Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 09 八月 2023 11:27:45 +0800
Subject: [PATCH] 空调,地暖温度类型支持
---
HDL_ON/Entity/Function/Scene.cs | 6
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs | 7
HDL-ON_Android/Properties/AndroidManifest.xml | 2
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 6
HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 4
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs | 19
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 18
HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs | 5
HDL_ON/Entity/Function/Function.cs | 10
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 2
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 4
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs | 7
HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs | 42
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 1918 +-----------------------------------------------------
HDL_ON/DAL/DriverLayer/Control.cs | 3
HDL_ON/UI/MainPage.cs | 8
HDL_ON/DAL/DriverLayer/Control_TcpClient.cs | 1
HDL_ON/UI/UI1-Login/LoginPage.cs | 3
18 files changed, 156 insertions(+), 1,909 deletions(-)
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index ebae154..24f5cd7 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308071">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308091">
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<!--鍙嬬洘-->
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index e4cebab..e8a9655 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -261,6 +261,7 @@
/// </summary>
public void OpenTcpClent()
{
+ return;
if (myTcpClient == null)
{
myTcpClient = new Control_TcpClient(reportIp);
@@ -1107,7 +1108,7 @@
Ins.IsLocalEncrypt = device.isLocalEncrypt;
//MainPage.Log("缃戝叧鏈湴鍔犲瘑鐘舵�侊細" + device.local_encrypt.ToString());
//鐧诲綍缃戝叧Tcp
- OpenTcpClent();
+ //OpenTcpClent();
}
diff --git a/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs b/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs
index bf82c8e..84e305b 100644
--- a/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs
@@ -130,6 +130,7 @@
/// </summary>
public void Connect()
{
+ return;
lock (lockObj)
{
if (isConnected)
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 105de09..557e8fa 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -888,13 +888,13 @@
var tt = GetAttribute(FunctionAttributeKey.TempType);
if (tt == null)
{
- attr.unit = "掳C";
+ attr.unit = "掳";
}
else
{
if (tt.unit == string.Empty)
{
- attr.unit = "掳C";
+ attr.unit = "掳";
}
else
{
@@ -1909,6 +1909,8 @@
{
var spkList = new List<string>();
spkList.Add(ElectricEnergy);
+ spkList.Add(AirSwitch);
+ spkList.Add(AirSwitchP3);
return spkList;
}
#endregion
@@ -2253,8 +2255,8 @@
spkList.Add(ElectricTuyaWeepRobot2);
spkList.Add(ElectricTuyaWaterValve);
spkList.Add(ElectricTuyaWaterValve2);
- spkList.Add(AirSwitch);
- spkList.Add(AirSwitchP3);
+ //spkList.Add(AirSwitch);
+ //spkList.Add(AirSwitchP3);
return spkList;
}
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index df2aa7f..2fd46a9 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -597,8 +597,8 @@
}
if (tempState != null)
{
- sceneFunctionInfo += tempState.GetValueText() + " ";
- sceneFunctionInfo += tempState.GetUintString();
+ sceneFunctionInfo += tempState.GetValueText();
+ sceneFunctionInfo += tempState.GetUintString() + " ";
}
if (fanState != null)
{
@@ -726,7 +726,7 @@
{
case FunctionAttributeKey.SetTemp:
case FunctionAttributeKey.RoomTemp:
- us = "掳C";
+ us = "掳";
break;
case FunctionAttributeKey.Percent:
case FunctionAttributeKey.Brightness:
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 4485bc1..1007be9 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -163,6 +163,14 @@
BaseView = Application.MainPage;
Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor;
+ //Application.MainPage.BackgroundColor = 0xFFFF0000;// CSS_Color.MainBackgroundColor;
+ //BaseView = new FrameLayout()
+ //{
+ // Y = Application.GetRealHeight(20),
+ // Width = Application.GetRealWidth(376),
+ // Height = Application.GetRealHeight(667),
+ //};
+ //Application.MainPage.AddChidren(BaseView);
Language.UpdateLanguage();
//#region 娴嬭瘯
//var ddd = new UI.test.TestDialog();
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
index 2f1ba90..06066e1 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -22,6 +22,12 @@
//璺宠浆鍒板姛鑳戒俊鎭缃〉闈�
switch (function.spk)
{
+ case SPK.ElectricEnergy:
+ var skipView = new EnergyMainPage();
+ MainPage.BasePageView.AddChidren(skipView);
+ skipView.LoadPage();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ break;
case SPK.GroupControl:
//var dialog = new GroupControlPage(FunctionList.List.groupControls.Find((obj) => obj.sid == function.sid));
//dialog.ShowDialog();
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index 85f7dd1..24bc191 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -1714,7 +1714,8 @@
new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, curValue = "on", state = "on" },
new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, curValue = "cool", state = "cool" },
new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, curValue = "auto", state = "auto" },
- new FunctionAttributes() { key = "set_temp",step = "1", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 },
+ new FunctionAttributes() { key = "set_temp",unit = "F", step = "1", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 },
+ new FunctionAttributes() { key = FunctionAttributeKey.TempType,unit = "F", step = "1", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 },
new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, curValue = "20", state = "20" },
new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, curValue = "20", state = "20" },
}
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index f350396..db57943 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1561,6 +1561,10 @@
// btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/lightswitch_blue.png";
// btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/lightswitch_white.png";
//}
+ else if (function.spk == SPK.ElectricEnergy || function.spk == SPK.AirSwitch || function.spk == SPK.AirSwitchP3)
+ {
+
+ }
else
{
Button btnSwitch;
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 1007679..c5fc92d 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -1055,13 +1055,15 @@
case ShowFunction.EnergyMonitoring:
#region 鑳芥簮鐩戞祴
btnName.TextID = StringId.EnergyMonitoring;
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
- {
- var skipView = new EnergyMainPage();
- MainPage.BasePageView.AddChidren(skipView);
- skipView.LoadPage();
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
- };
+ functionPageTitleId = StringId.EnergyMonitoring;
+
+ //btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ //{
+ // var skipView = new EnergyMainPage();
+ // MainPage.BasePageView.AddChidren(skipView);
+ // skipView.LoadPage();
+ // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ //};
#endregion
break;
case ShowFunction.Environmental:
@@ -1209,7 +1211,7 @@
&& item != ShowFunction.Environmental
&& item != ShowFunction.SecurityMonitoring
&& item != ShowFunction.DoorLock
- && ShowFunction.EnergyMonitoring != item
+ //&& ShowFunction.EnergyMonitoring != item
&& ShowFunction.VideoIntercom != item
&& ShowFunction.SecurityCenter != item
&& ShowFunction.Series != item
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index 88a7bf4..3d155e7 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -271,7 +271,7 @@
{
ClothesHangerFragment();
}
- else if(function.spk == SPK.IpCam_Imou)
+ else if(function.spk == SPK.IpCam_Imou || function.spk == SPK.ElectricEnergy || function.spk ==SPK.AirSwitch || function.spk == SPK.AirSwitchP3)
{
}
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
index d1d6639..7ff91dc 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -207,6 +207,10 @@
{
functionList.AddRange(FunctionList.List.GetIpCamImouList());
}
+ else if(titleId == StringId.EnergyMonitoring)
+ {
+ functionList.AddRange(FunctionList.List.GetEnergyList());
+ }
functionList = functionList.OrderByDescending(o => o.controlCounter).ToList();
ShowFunctionRow(functionList);
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
index 8098182..4373932 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -493,9 +493,22 @@
//灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45
foreach (var tt in scenefunction.status)
{
- tt.min = scenefunction.localFunction.GetAttribute(tt.key).min;
- tt.max = scenefunction.localFunction.GetAttribute(tt.key).max;
- tt.valueList = scenefunction.localFunction.GetAttribute(tt.key).value;
+ var attr = scenefunction.localFunction.GetAttribute(tt.key);
+ if(attr == null)
+ {
+ continue;
+ }
+ tt.min = attr.min;
+ tt.max = attr.max;
+ tt.valueList = attr.value;
+ if(tt.key == FunctionAttributeKey.SetTemp)
+ {
+ var tempType = scenefunction.localFunction.GetAttribute(FunctionAttributeKey.TempType);
+ if(tempType != null)
+ {
+ tt.UintString = tempType.unit;
+ }
+ }
}
}catch(Exception ex)
{
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 08bfede..0974ade 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -1,1843 +1,4 @@
-锘�//using System;
-//using HDL_ON.Entity;
-//using HDL_ON.UI.CSS;
-//using Shared;
-//using System.Collections.Generic;
-
-//namespace HDL_ON.UI
-//{
-// public class SceneFunctionInfoEditPage : FrameLayout
-// {
-// FrameLayout bodyView;
-// VerticalScrolViewLayout contentView;
-// Button btnOnText;
-// Button btnBrightnessText;
-
-// Scene scene;
-
-// Action refreshAction;
-// SceneFunction sceneFunction;
-
-// bool isColorful = false;
-
-// public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action)
-// {
-// bodyView = this;
-// scene = s;
-// sceneFunction = fc.localFunction.ConvertSceneFunction();
-// foreach(var ll in sceneFunction.status)
-// {
-// try
-// {
-// var temp = fc.status.Find((obj) => obj.key == ll.key);
-// if (temp != null)
-// ll.value = temp.value;
-// }
-// catch { }
-// }
-// refreshAction = action;
-// }
-
-// public void LoadPage()
-// {
-// bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-
-// new TopViewDiv(bodyView, sceneFunction.localFunction.name).LoadTopView();
-
-// contentView = new VerticalScrolViewLayout()
-// {
-// Y = Application.GetRealHeight(64),
-// Height = Application.GetRealHeight(520),
-// ScrollEnabled = false,
-// };
-// bodyView.AddChidren(contentView);
-
-// var onOffStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
-
-// LoadFunctionRow(onOffStatus);
-
-// if (sceneFunction.localFunction.spk == SPK.LightRGB)
-// {
-// var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
-// if (colorfulStatus != null)
-// {
-// isColorful = true;
-// LoadColorfulRow(colorfulStatus);
-// }
-// }
-// if(!isColorful)
-// {
-// foreach (var attr in sceneFunction.status)
-// {
-// switch (attr.key)
-// {
-// case FunctionAttributeKey.SetTemp:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp));
-// break;
-// case FunctionAttributeKey.Mode:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode));
-// break;
-// case FunctionAttributeKey.FanSpeed:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed));
-// break;
-// case FunctionAttributeKey.Percent:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent));
-// break;
-// case FunctionAttributeKey.Brightness:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness));
-// break;
-// case FunctionAttributeKey.FadeTime:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FadeTime));
-// break;
-// case FunctionAttributeKey.CCT:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.CCT));
-// break;
-// case FunctionAttributeKey.RGB:
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.RGB));
-// break;
-// case "angle"://瑙掑害
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "angle"));
-// break;
-// case "security"://澶у崕鎽勫儚甯冮槻鎾ら槻
-// LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "security"));
-// break;
-// }
-// }
-
-// if (DB_ResidenceData.Instance.GatewayType != 0)
-// {
-// //鍔犺浇寤舵椂Row
-// LoadDelayRow();
-// }
-// }
-// var bottomView = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(591),
-// Height = Application.GetRealHeight(106),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Radius = (uint)Application.GetRealWidth(16),
-// };
-// bodyView.AddChidren(bottomView);
-
-// var btnConfrim = new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// Y = Application.GetRealHeight(12),
-// Width = Application.GetRealWidth(220),
-// Height = Application.GetRealWidth(44),
-// TextAlignment = TextAlignment.Center,
-// TextColor = CSS_Color.MainBackgroundColor,
-// BackgroundColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// IsBold = true,
-// Radius = (uint) Application.GetRealWidth(22),
-// TextID = StringId.Complete
-// };
-// bottomView.AddChidren(btnConfrim);
-
-// btnConfrim.MouseUpEventHandler = (sender, e) =>
-// {
-// var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid);
-
-// if (temp != null)
-// {
-// 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
-// {
-// scene.functions.Add(sceneFunction);
-// }
-// if (!string.IsNullOrEmpty(scene.userSceneId))
-// {
-// var result = scene.UpdateScene();
-// if (result == DAL.Server.StateCode.SUCCESS)
-// {
-// refreshAction();
-// this.RemoveFromParent();
-// }
-// else
-// {
-// DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(result);
-// }
-// }
-// else
-// {
-// refreshAction();
-// this.RemoveFromParent();
-// }
-// };
-// }
-
-
-// /// <summary>
-// /// 鍔犺浇鍔熻兘Row
-// /// </summary>
-// void LoadFunctionRow(SceneFunctionStatus sceneStatus)
-// {
-// if (sceneStatus == null)
-// return;
-// #region Row code
-// var row = new FrameLayout()
-// {
-// Height = Application.GetRealHeight(50),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// };
-// contentView.AddChidren(row);
-
-
-// if (sceneStatus.key != FunctionAttributeKey.OnOff)
-// {
-// row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
-// }
-// else
-// {
-// if(sceneStatus.value == "stop")
-// {
-// sceneStatus.value = "on";
-// }
-// }
-// Button btnRight = new Button()
-// {
-// X = Application.GetRealWidth(339),
-// Gravity = Gravity.CenterVertical,
-// Width = Application.GetMinRealAverage(16),
-// Height = Application.GetMinRealAverage(16),
-// UnSelectedImagePath = "Public/Right.png",
-// };
-// row.AddChidren(btnRight);
-
-
-// var showCode = "";
-
-// if (sceneStatus.key == FunctionAttributeKey.Mode)
-// {
-// if (DB_ResidenceData.Instance.GatewayType == 0)
-// {
-// if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk))
-// {
-// //0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍
-// switch (sceneStatus.value)
-// {
-// case "0":
-// showCode = "cool";
-// break;
-// case "1":
-// showCode = "heat";
-// break;
-// case "2":
-// showCode = "fan";
-// break;
-// case "3":
-// showCode = "auto";
-// break;
-// case "4":
-// showCode = "dry";
-// break;
-// }
-// }
-// else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk))
-// {
-// //1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿
-// switch (sceneStatus.value)
-// {
-// case "5":
-// showCode = "timer";
-// break;
-// case "1":
-// showCode = "normal";
-// break;
-// case "2":
-// showCode = "day";
-// break;
-// case "3":
-// showCode = "night";
-// break;
-// case "4":
-// showCode = "away";
-// break;
-// }
-// }
-// }
-// }
-
-// var btnFunctionText = new Button()
-// {
-// Width = Application.GetRealWidth(330),
-// TextAlignment = TextAlignment.CenterRight,
-// TextColor = CSS_Color.PromptingColor1,
-// TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// Text = sceneStatus.GetValueText(showCode) + sceneStatus.GetUintString()
-// };
-// row.AddChidren(btnFunctionText);
-// if (sceneStatus.key == FunctionAttributeKey.RGB)
-// {
-// btnFunctionText.Width = Application.GetRealWidth(28);
-// btnFunctionText.Height = Application.GetRealWidth(28);
-// btnFunctionText.X = Application.GetRealWidth(330 - 28);
-// btnFunctionText.Gravity = Gravity.CenterVertical;
-// btnFunctionText.Radius = (uint)Application.GetRealWidth(8);
-// btnFunctionText.Text = "";
-// btnFunctionText.BackgroundColor = (uint)(0xFF000000 + new Light().GetRGBcolor(sceneStatus.value));
-// }
-
-
-
-// if (sceneStatus.key == FunctionAttributeKey.OnOff)
-// {
-// btnOnText = btnFunctionText;
-// }
-// else if (sceneStatus.key == FunctionAttributeKey.Brightness || sceneStatus.key == FunctionAttributeKey.Percent)
-// {
-// int outT = 0;
-// int.TryParse(sceneStatus.value, out outT);
-// if (outT < 0)
-// sceneStatus.value = "0";
-// btnBrightnessText = btnFunctionText;
-// }
-
-// var btnFunctionName = new Button()
-// {
-// X = Application.GetRealWidth(16),
-// TextAlignment = TextAlignment.CenterLeft,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// Text = sceneStatus.GetNameText()
-// };
-// row.AddChidren(btnFunctionName);
-// btnFunctionName.MouseUpEventHandler = (sender, e) =>
-// {
-// switch (sceneStatus.key)
-// {
-// case FunctionAttributeKey.Security:
-// LoadEditDialog_Security(sceneStatus, btnFunctionText);
-// break;
-// case FunctionAttributeKey.OnOff:
-// LoadEditDialog_OnOff(sceneStatus, btnFunctionText);
-// break;
-// case FunctionAttributeKey.Brightness:
-// LoadEditDialog_Percent(sceneStatus, btnFunctionText);
-// break;
-// case FunctionAttributeKey.Mode:
-// var statusList = new List<string>();
-// var tr = sceneFunction.localFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.Mode);
-// foreach(var t in tr.value)
-// {
-// statusList.Add(t);
-// }
-// LoadEditDialog_FunctionPar(sceneStatus, btnFunctionText,statusList);
-// break;
-// case FunctionAttributeKey.FanSpeed:
-// var fanStatusList = new List<string>();
-// var tr1 = sceneFunction.localFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
-// foreach (var t in tr1.value)
-// {
-// fanStatusList.Add(t);
-// }
-// LoadEditDialog_FunctionPar(sceneStatus, btnFunctionText, fanStatusList);
-// break;
-// case FunctionAttributeKey.SetTemp:
-// LoadEditDialog_Temp(sceneStatus, btnFunctionText);
-// break;
-// case FunctionAttributeKey.FadeTime:
-
-// break;
-// case "angle":
-// //鍛堢幇鐨勫脊绐�
-// LoadEditDialog_Angle(sceneStatus, btnFunctionText);
-
-// break;
-// case "cct":
-// LoadEditDialog_CCT(sceneStatus, btnFunctionText);
-// break;
-// case FunctionAttributeKey.RGB:
-// btnFunctionText.Width = Application.GetRealWidth(28);
-// btnFunctionText.Height = Application.GetRealWidth(28);
-// btnFunctionText.X = Application.GetRealWidth(330 - 28);
-// btnFunctionText.Gravity = Gravity.CenterVertical;
-// btnFunctionText.Radius = (uint)Application.GetRealWidth(8);
-// btnFunctionText.Text = "";
-
-// LoadEditDialog_RGB(sceneStatus, btnFunctionText);
-// break;
-// case FunctionAttributeKey.Percent:
-// LoadEditDialog_Percent(sceneStatus, btnFunctionText);
-// break;
-// }
-// };
-
-// #endregion
-// }
-
-// /// <summary>
-// /// 鍔犺浇鍔熻兘Row
-// /// </summary>
-// void LoadColorfulRow(SceneFunctionStatus sceneStatus)
-// {
-// if (sceneStatus == null)
-// return;
-// #region Row code
-// var row = new FrameLayout()
-// {
-// Height = Application.GetRealHeight(50),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// };
-// contentView.AddChidren(row);
-
-// row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
-
-// Button btnRight = new Button()
-// {
-// X = Application.GetRealWidth(339),
-// Gravity = Gravity.CenterVertical,
-// Width = Application.GetMinRealAverage(16),
-// Height = Application.GetMinRealAverage(16),
-// UnSelectedImagePath = "Public/Right.png",
-// };
-// row.AddChidren(btnRight);
-
-
-// var showCode = "";
-
-// var btnFunctionText = new Button()
-// {
-// Width = Application.GetRealWidth(330),
-// TextAlignment = TextAlignment.CenterRight,
-// TextColor = CSS_Color.PromptingColor1,
-// TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// Text = sceneStatus.GetValueText(showCode)
-// };
-// row.AddChidren(btnFunctionText);
-
-// var btnFunctionName = new Button()
-// {
-// X = Application.GetRealWidth(16),
-// TextAlignment = TextAlignment.CenterLeft,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.ColorfulFunction
-// };
-// row.AddChidren(btnFunctionName);
-// btnFunctionName.MouseUpEventHandler = (sender, e) =>
-// {
-// LoadEditDialog_OnOff(sceneStatus, btnFunctionText);
-// };
-
-// #endregion
-// }
-
-
-
-// #region 鍔犺浇鍔熻兘鍦烘櫙鏁版嵁璋冭妭鐣岄潰
-// /// <summary>
-// /// 鍔犺浇寤舵椂Row
-// /// </summary>
-// void LoadDelayRow()
-// {
-// #region 寤舵椂row
-// FrameLayout delayRow = new FrameLayout()
-// {
-// Height = Application.GetRealWidth(50),
-// BackgroundColor = CSS_Color.MainBackgroundColor
-// };
-// contentView.AddChidren(delayRow);
-// delayRow.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
-
-// Button btnDelayRight = new Button()
-// {
-// X = Application.GetRealWidth(339),
-// Gravity = Gravity.CenterVertical,
-// Width = Application.GetMinRealAverage(16),
-// Height = Application.GetMinRealAverage(16),
-// UnSelectedImagePath = "Public/Right.png",
-// };
-// delayRow.AddChidren(btnDelayRight);
-
-// var btnDelayInfo = new Button()
-// {
-// Width = Application.GetRealWidth(327),
-// TextAlignment = TextAlignment.CenterRight,
-// TextColor = CSS_Color.PromptingColor1,
-// TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// Text = new Scene() { delay = sceneFunction.delay }.GetDelayText()
-// };
-// delayRow.AddChidren(btnDelayInfo);
-
-// Button btnSceneDelayTitle = new Button()
-// {
-// X = Application.GetRealWidth(16),
-// TextAlignment = TextAlignment.CenterLeft,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.Delay,
-// };
-// delayRow.AddChidren(btnSceneDelayTitle);
-
-
-// btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => {
-// Action<string> action = (obj) => {
-// sceneFunction.delay = obj;
-// btnDelayInfo.Text = new Scene() { delay = sceneFunction.delay }.GetDelayText();
-// };
-// Dictionary<string, string> items = new Dictionary<string, string>();
-// items.Add("30", "30s");
-// items.Add("60", "1min");
-// items.Add("120", "2min");
-// items.Add("300", "5min");
-// new PublicAssmebly().SetSceneDelayDialog(action, sceneFunction.delay);
-// };
-// #endregion
-
-
-// }
-
-// #endregion
-
-// #region 灞炴�ч�夋嫨寮圭獥
-// /// <summary>
-// /// 鍔犺浇寮�鍏抽�夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_OnOff(SceneFunctionStatus trait, Button btn)
-// {
-// Dialog dialog = new Dialog();
-
-// var pView = new FrameLayout()
-// {
-// BackgroundColor = CSS_Color.DialogTransparentColor1,
-// };
-// dialog.AddChidren(pView);
-
-// var optionBaseView = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(500),
-// Height = Application.GetRealHeight(160),
-// AnimateSpeed = 0.3f,
-// Animate = Animate.DownToUp,
-// };
-// pView.AddChidren(optionBaseView);
-
-// var optionView = new VerticalScrolViewLayout()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(100),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Radius = (uint)Application.GetRealWidth(12),
-// ScrollEnabled = false,
-// };
-// optionBaseView.AddChidren(optionView);
-
-// var btnOn = new Button()
-// {
-// Height = Application.GetRealHeight(50),
-// TextAlignment = TextAlignment.Center,
-// TextColor = CSS_Color.TextualColor,
-// SelectedTextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.On,
-// IsSelected = trait.value.ToString() == "on"
-// };
-// optionView.AddChidren(btnOn);
-
-// optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
-
-// var btnOff = new Button()
-// {
-// Height = Application.GetRealHeight(50),
-// TextAlignment = TextAlignment.Center,
-// TextColor = CSS_Color.TextualColor,
-// SelectedTextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.OFF,
-// IsSelected = trait.value.ToString() == "off"
-// };
-// optionView.AddChidren(btnOff);
-
-// var btnCancel = new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// Y = Application.GetRealHeight(8) + optionView.Bottom,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(50),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Radius = (uint)Application.GetRealWidth(12),
-// TextID = StringId.Cancel,
-// TextColor = CSS_Color.WarningColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// };
-// optionBaseView.AddChidren(btnCancel);
-
-// dialog.Show();
-
-// pView.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-
-// btnCancel.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-// btnOn.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// trait.value = "on";
-// sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on";
-// btn.Text = trait.GetValueText() + trait.GetUintString();
-
-// var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
-// if (temp == null)
-// {
-// temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
-// }
-// if (temp != null)
-// {
-// if (temp.value == "0")
-// {
-// temp.value = "100";
-// }
-// btnBrightnessText.Text = temp.GetValueText() + "%";
-// }
-// };
-// btnOff.MouseUpEventHandler = (sender,e) =>{
-// dialog.Close();
-// trait.value = "off";
-// sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off";
-// btn.Text= trait.GetValueText() + trait.GetUintString();
-
-// var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
-// if(temp == null)
-// {
-// temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
-// }
-// if (temp != null)
-// {
-// if (temp.value != "0")
-// {
-// temp.value = "0";
-// }
-// btnBrightnessText.Text = temp.GetValueText() + "%";
-// }
-// };
-
-// }
-
-
-// /// <summary>
-// /// 鍔犺浇瀹夐槻甯冮槻閫夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_Security(SceneFunctionStatus trait, Button btn)
-// {
-// Dialog dialog = new Dialog();
-
-// var pView = new FrameLayout()
-// {
-// BackgroundColor = CSS_Color.DialogTransparentColor1,
-// };
-// dialog.AddChidren(pView);
-
-// var optionBaseView = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(500),
-// Height = Application.GetRealHeight(160),
-// AnimateSpeed = 0.3f,
-// Animate = Animate.DownToUp,
-// };
-// pView.AddChidren(optionBaseView);
-
-// var optionView = new VerticalScrolViewLayout()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(100),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Radius = (uint)Application.GetRealWidth(12),
-// ScrollEnabled = false,
-// };
-// optionBaseView.AddChidren(optionView);
-
-// var btnOn = new Button()
-// {
-// Height = Application.GetRealHeight(50),
-// TextAlignment = TextAlignment.Center,
-// TextColor = CSS_Color.TextualColor,
-// SelectedTextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.Defense,
-// IsSelected = trait.value.ToString() == "true"
-// };
-// optionView.AddChidren(btnOn);
-
-// optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
-
-// var btnOff = new Button()
-// {
-// Height = Application.GetRealHeight(50),
-// TextAlignment = TextAlignment.Center,
-// TextColor = CSS_Color.TextualColor,
-// SelectedTextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.Undefense,
-// IsSelected = trait.value.ToString() == "false"
-// };
-// optionView.AddChidren(btnOff);
-
-// var btnCancel = new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// Y = Application.GetRealHeight(8) + optionView.Bottom,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(50),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Radius = (uint)Application.GetRealWidth(12),
-// TextID = StringId.Cancel,
-// TextColor = CSS_Color.WarningColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// };
-// optionBaseView.AddChidren(btnCancel);
-
-// dialog.Show();
-
-// pView.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-
-// btnCancel.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-// btnOn.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// trait.value = "true";
-// sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Security).value = "true";
-// btn.Text = trait.GetValueText() + trait.GetUintString();
-
-// };
-// btnOff.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// trait.value = "false";
-// sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Security).value = "false";
-// btn.Text = trait.GetValueText() + trait.GetUintString();
-
-// };
-
-// }
-
-
-// /// <summary>
-// /// 鍔犺浇娓╁害閫夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_Temp(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()), 4, 5);
-
-// string selectItem = pickerItems[0];
-// if (pickerItems.Contains(trait.value + trait.GetUintString()))
-// {
-// selectItem = trait.value.ToString() + trait.GetUintString();
-// }
-
-// 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>
-// /// 鍔犺浇娓╁害閫夋嫨寮圭獥
-// /// </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>
-// /// 鍔犺浇浜害閫夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_Percent(SceneFunctionStatus trait, Button btn)
-// {
-// 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(467),
-// Gravity = Gravity.CenterHorizontal,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(180),
-// 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 btnTitle = new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// TextAlignment = TextAlignment.Center,
-// Width = Application.GetRealWidth(100),
-// Text = trait.GetNameText(),
-// IsBold = true,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// };
-// topView.AddChidren(btnTitle);
-
-// 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(200),
-// Width = Application.GetRealWidth(120),
-// TextAlignment = TextAlignment.CenterRight,
-// TextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.TextFontSize,
-// TextID = StringId.Confirm,
-// };
-// topView.AddChidren(btnConfrim);
-
-// Button btnMinusSignIcon = new Button()
-// {
-// X = Application.GetRealWidth(26),
-// Y = Application.GetRealHeight(118),
-// Width = Application.GetMinRealAverage(24),
-// Height = Application.GetMinRealAverage(24),
-// UnSelectedImagePath = "Public/MinusSignIcon.png",
-// };
-// optionBaseView.AddChidren(btnMinusSignIcon);
-
-// DiyImageSeekBar controlBar = new DiyImageSeekBar()
-// {
-// X = btnMinusSignIcon.Right + Application.GetRealWidth(12),
-// Y = Application.GetRealHeight(100),//414,璁捐鏁版嵁
-// Width = Application.GetRealWidth(220),
-// Height = Application.GetRealHeight(54),
-// SeekBarViewHeight = Application.GetRealHeight(8),
-// ThumbImagePath = "Public/ThumbImage.png",
-// ThumbImageHeight = Application.GetRealHeight(54),
-// ProgressBarColor = CSS_Color.MainColor,
-// ProgressTextColor = CSS_Color.FirstLevelTitleColor,
-// ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// MaxValue = 100,
-// Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")),
-// SeekBarPadding = Application.GetRealWidth(20),
-// };
-// optionBaseView.AddChidren(controlBar);
-
-// Button btnPlusSgnIcon = new Button()
-// {
-// X = controlBar.Right + Application.GetRealWidth(12),
-// Y = Application.GetRealHeight(118),
-// Width = Application.GetMinRealAverage(24),
-// Height = Application.GetMinRealAverage(24),
-// UnSelectedImagePath = "Public/PlusSignIcon.png",
-// };
-// optionBaseView.AddChidren(btnPlusSgnIcon);
-
-// btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
-// {
-// controlBar.Progress--;
-// };
-// btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
-// {
-// controlBar.Progress++;
-// };
-
-// dialog.Show();
-// pView.MouseUpEventHandler = (sender, e) =>
-// {
-// dialog.Close();
-// };
-
-// btnCancel.MouseUpEventHandler = (sender, e) =>
-// {
-// dialog.Close();
-// };
-// btnConfrim.MouseUpEventHandler = (sender, e) =>
-// {
-// dialog.Close();
-// trait.value = controlBar.Progress.ToString();
-// btn.Text = trait.value + trait.GetUintString();
-
-// var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
-// if (temp != null)
-// {
-// if (controlBar.Progress > 0)
-// {
-// temp.value = "on";
-// }
-// else
-// {
-// temp.value = "off";
-// }
-// btnOnText.Text = temp.GetValueText();
-// }
-// };
-// }
-
-
-// /// <summary>
-// /// 鍔犺浇cct閫夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_CCT(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(200),
-// Width = Application.GetRealWidth(120),
-// 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 += 100)
-// {
-// pickerItems.Add(i.ToString() + trait.GetUintString());
-// }
-// uIPickerView.setNPicker(pickerItems, null, null);
-// optionBaseView.AddChidren(uIPickerView);
-// uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5);
-
-// string selectItem = pickerItems[0];
-// if (pickerItems.Contains(trait.value + trait.GetUintString()))
-// {
-// selectItem = trait.value.ToString() + trait.GetUintString();
-// }
-
-// 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>
-// /// 鍔犺浇rgb閫夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_RGB(SceneFunctionStatus trait, Button btn)
-// {
-// string rgbString = trait.value;
-
-// Light tempLight = new Light();
-
-// if (trait == null)
-// {
-// return;
-// }
-
-// Dialog dialog = new Dialog();
-
-// var bodyView = new FrameLayout();
-// dialog.AddChidren(bodyView);
-
-// var contentView = new FrameLayout()
-// {
-// Gravity = Gravity.Center,
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(52 + 44 + 18 + 22 + 248),
-// Radius = (uint)Application.GetRealWidth(12),
-// };
-// bodyView.AddChidren(contentView);
-
-// #region 鏍囬鍖�
-// var titleView = new FrameLayout()
-// {
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(52),
-// };
-// contentView.AddChidren(titleView);
-
-// var btnTitle = new Button()
-// {
-// Height = Application.GetRealHeight(52),
-// Gravity = Gravity.Center,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextColor = CSS_Color.MainColor,
-// TextID = StringId.ColorValue,
-// TextAlignment = TextAlignment.Center,
-// };
-// titleView.AddChidren(btnTitle);
-// titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) });
-
-// #endregion
-
-// int attrViewHight = Application.GetRealHeight(18 + 22+ 248);
-// //灞炴�ц缃尯鍩�
-// var attrView = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(52),
-// Width = Application.GetRealWidth(343),
-// Height = attrViewHight
-// };
-// contentView.AddChidren(attrView);
-// attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
-
-
-
-// #region RGB
-// var rgbView = new FrameLayout()
-// {
-// Height = Application.GetRealHeight(248)
-// };
-// attrView.AddChidren(rgbView);
-
-
-// var btnCurColor = new Button()
-// {
-// X = Application.GetRealWidth(24),
-// Y = Application.GetRealHeight(10),
-// Width = Application.GetMinRealAverage(24),
-// Height = Application.GetMinRealAverage(24),
-// Radius = (uint)Application.GetMinRealAverage(8),
-// BorderColor = CSS_Color.PromptingColor2,
-// BorderWidth = 1,
-// BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(trait.value))
-// };
-// rgbView.AddChidren(btnCurColor);
-
-// //鑹茬洏鐨勬甯冩帶浠�(闄愬埗閭d釜鐧借壊婊戝姩鐞冧娇鐢�)
-// var framePickerBack = new FrameLayout();
-// framePickerBack.Gravity = Gravity.CenterHorizontal;
-// framePickerBack.Y = Application.GetRealHeight(20);
-// framePickerBack.Width = Application.GetMinRealAverage(198);
-// framePickerBack.Height = Application.GetMinRealAverage(198);
-// rgbView.AddChidren(framePickerBack);
-
-// var colorPicker = new ColorPicker()
-// {
-// ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
-// };
-// framePickerBack.AddChidren(colorPicker);
-
-
-
-
-
-
-// //鐧界偣鎺т欢
-// var btnWhiteRound = new Button();
-// btnWhiteRound.Width = Application.GetRealWidth(24);
-// btnWhiteRound.Height = Application.GetRealWidth(24);
-// btnWhiteRound.UnSelectedImagePath = "FunctionIcon/Light/ColorWheelTip.png";
-// btnWhiteRound.Visible = false;
-// framePickerBack.AddChidren(btnWhiteRound);
-
-
-// //褰撳墠鐐瑰嚮鐨勩�愮偣銆戞槸鍚︽纭�
-// bool pointIsRight = false;
-// //鍦嗙殑鍗婂緞(鑰冭檻杈圭晫,闇�瑕佽缃畠鐨勫崐寰勬瘮杈冨皬涓�鐐�)
-// int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
-
-
-// colorPicker.ColorChaged += (sender2, e2) => {
-// rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString();
-// //trait.value = rgbString;
-// btnCurColor.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString));
-// };
-// colorPicker.MouseDownEventHandler += (sender, e) =>
-// {
-// pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
-// if (pointIsRight == false)
-// {
-// //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
-// return;
-// }
-// //鏄剧ず鐧界偣
-// btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
-// btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
-// if (btnWhiteRound.Visible == false)
-// {
-// btnWhiteRound.Visible = true;
-// }
-// };
-
-// colorPicker.MouseMoveEventHandler += (sender, e) =>
-// {
-// //褰撻紶鏍囩偣涓嬩簨浠跺鐞�
-// colorPicker.MouseDownEventHandler(sender, e);
-// };
-
-
-// #endregion
-
-
-
-
-// #region bottom View
-// var bottomView = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(52) + attrViewHight,
-// Height = Application.GetRealHeight(46),
-// };
-// contentView.AddChidren(bottomView);
-// bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
-
-// var btnCancel = new Button()
-// {
-// Width = Application.GetRealWidth(172),
-// Height = Application.GetRealHeight(44),
-// TextAlignment = TextAlignment.Center,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextColor = CSS_Color.TextualColor,
-// TextID = StringId.Cancel,
-// };
-// bottomView.AddChidren(btnCancel);
-// btnCancel.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-
-// var btnComplete = new Button()
-// {
-// X = Application.GetRealWidth(172),
-// Width = Application.GetRealWidth(172),
-// Height = Application.GetRealHeight(46),
-// BackgroundColor = CSS_Color.MainColor,
-// TextColor = CSS_Color.MainBackgroundColor,
-// TextAlignment = TextAlignment.Center,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// TextID = StringId.Complete
-// };
-// bottomView.AddChidren(btnComplete);
-
-// //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
-// int mRectCornerID = HDLUtils.RectCornerBottomRight;
-// btnComplete.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID);
-// btnComplete.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// trait.value = rgbString;
-// btn.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString));
-// };
-
-// #endregion
-
-
-// dialog.Show();
-
-// }
-
-
-// /// <summary>
-// /// 妫�娴嬬偣鍑荤偣
-// /// </summary>
-// /// <param name="circleR">鍦嗙殑鍗婂緞</param>
-// /// <param name="circleX">鍦嗗績X杞�</param>
-// /// <param name="circleY">鍦嗗績Y杞�</param>
-// /// <param name="pointX">鐐瑰嚮鐐圭殑X杞�</param>
-// /// <param name="pointY">鐐瑰嚮鐐圭殑Y杞�</param>
-// /// <returns></returns>
-// private bool CheckPoint(int circleR, int circleX, int circleY, int pointX, int pointY)
-// {
-// int dwidth = circleX - pointX;
-// if (dwidth < 0) { dwidth *= -1; }
-
-// int dHeight = circleY - pointY;
-// if (dHeight < 0) { dHeight *= -1; }
-
-// //鏍规嵁涓夎鍑芥暟,姹備笁瑙掑舰鐨勬枩杈归暱
-// int dlength = dwidth * dwidth + dHeight * dHeight;
-// //鍗婂緞闀垮害(涓嶅紑鏂�,鎵�浠ユ槸鎸夊钩鏂圭畻)
-// circleR *= circleR;
-// if (dlength < circleR)
-// {
-// //濡傛灉缁勬垚鐨勪笁瑙掑舰骞舵病鏈夐暱杩囧崐寰�,鍒欎唬琛ㄨ繕鍦ㄥ渾鍐�(涓嶅厑璁哥偣杈圭晫)
-// return true;
-// }
-// return false;
-// }
-
-
-
-// /// <summary>
-// /// 鍔犺浇鍙樺寲閫熷害閫夋嫨寮圭獥
-// /// </summary>
-// /// <param name="function"></param>
-// /// <param name="btn"></param>
-// void LoadEditDialog_FadeTime(SceneFunctionStatus trait, Button btn)
-// {
-// 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(467),
-// Gravity = Gravity.CenterHorizontal,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(180),
-// 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 btnTitle = new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// TextAlignment = TextAlignment.Center,
-// Width = Application.GetRealWidth(100),
-// Text = trait.GetNameText(),
-// IsBold = true,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// };
-// topView.AddChidren(btnTitle);
-
-// 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(200),
-// Width = Application.GetRealWidth(120),
-// TextAlignment = TextAlignment.CenterRight,
-// TextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.TextFontSize,
-// TextID = StringId.Confirm,
-// };
-// topView.AddChidren(btnConfrim);
-
-// Button btnMinusSignIcon = new Button()
-// {
-// X = Application.GetRealWidth(26),
-// Y = Application.GetRealHeight(118),
-// Width = Application.GetMinRealAverage(24),
-// Height = Application.GetMinRealAverage(24),
-// Text = "0s",
-// TextColor = CSS_Color.PromptingColor1,
-// TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// };
-// optionBaseView.AddChidren(btnMinusSignIcon);
-
-// DiyImageSeekBar controlBar = new DiyImageSeekBar()
-// {
-// X = btnMinusSignIcon.Right + Application.GetRealWidth(12),
-// Y = Application.GetRealHeight(100),//414,璁捐鏁版嵁
-// Width = Application.GetRealWidth(220),
-// Height = Application.GetRealHeight(54),
-// SeekBarViewHeight = Application.GetRealHeight(8),
-// ThumbImagePath = "Public/ThumbImage.png",
-// ThumbImageHeight = Application.GetRealHeight(54),
-// ProgressBarColor = CSS_Color.MainColor,
-// ProgressTextColor = CSS_Color.FirstLevelTitleColor,
-// ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// MaxValue = 100,
-// Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")),
-// SeekBarPadding = Application.GetRealWidth(20),
-// };
-// optionBaseView.AddChidren(controlBar);
-
-// Button btnPlusSgnIcon = new Button()
-// {
-// X = controlBar.Right + Application.GetRealWidth(12),
-// Y = Application.GetRealHeight(118),
-// Width = Application.GetMinRealAverage(24),
-// Height = Application.GetMinRealAverage(24),
-// Text = "10s",
-// TextColor = CSS_Color.PromptingColor1,
-// TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-// };
-// optionBaseView.AddChidren(btnPlusSgnIcon);
-
-// btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
-// {
-// controlBar.Progress--;
-// };
-// btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
-// {
-// controlBar.Progress++;
-// };
-
-// dialog.Show();
-// pView.MouseUpEventHandler = (sender, e) =>
-// {
-// dialog.Close();
-// };
-
-// btnCancel.MouseUpEventHandler = (sender, e) =>
-// {
-// dialog.Close();
-// };
-// btnConfrim.MouseUpEventHandler = (sender, e) =>
-// {
-// dialog.Close();
-// trait.value = controlBar.Progress.ToString();
-// btn.Text = trait.value + trait.GetUintString();
-// };
-// }
-
-
-// /// <summary>
-// /// 鍔犺浇鍔熻兘灞炴�ф暟鎹�夋嫨寮圭獥
-// /// </summary>
-// void LoadEditDialog_FunctionPar(SceneFunctionStatus trait, Button btn,List<string> statusList)
-// {
-// Button lastButton = new Button();
-// var lastData = "";
-// var lastText = "";
-// Dialog dialog = new Dialog();
-
-// if(DB_ResidenceData.Instance.GatewayType == 0)
-// {
-// if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk))
-// {
-// //0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍
-// for (int i = 0; i < statusList.Count; i++)
-// {
-// if (statusList[i] == "0")
-// {
-// statusList[i] = "cool";
-// }
-// else if (statusList[i] == "1")
-// {
-// statusList[i] = "heat";
-// }
-// else if (statusList[i] == "2")
-// {
-// statusList[i] = "fan";
-// }
-// else if (statusList[i] == "3")
-// {
-// statusList[i] = "auto";
-// }
-// else if (statusList[i] == "4")
-// {
-// statusList[i] = "dry";
-// }
-// }
-// }
-// else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk))
-// {
-// //1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿
-// for (int i = 0; i < statusList.Count; i++)
-// {
-// if (statusList[i] == "5")
-// {
-// statusList[i] = "timer";
-// }
-// else if (statusList[i] == "1")
-// {
-// statusList[i] = "normal";
-// }
-// else if (statusList[i] == "2")
-// {
-// statusList[i] = "day";
-// }
-// else if (statusList[i] == "3")
-// {
-// statusList[i] = "night";
-// }
-// else if (statusList[i] == "4")
-// {
-// statusList[i] = "away";
-// }
-// }
-
-// }
-// }
-
-// var pView = new FrameLayout()
-// {
-// BackgroundColor = CSS_Color.DialogTransparentColor1,
-// };
-// dialog.AddChidren(pView);
-
-// var optionBaseView = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(579 - 50 * statusList.Count),
-// Gravity = Gravity.CenterHorizontal,
-// Width = Application.GetRealWidth(343),
-// Height = Application.GetRealHeight(50 * statusList.Count + 50),
-// 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(50),
-// BackgroundColor = CSS_Color.MainBackgroundColor,
-// Radius = (uint)Application.GetRealWidth(12),
-// };
-// optionBaseView.AddChidren(topView);
-
-// var btnTitle = new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// TextAlignment = TextAlignment.Center,
-// Width = Application.GetRealWidth(100),
-// Text = trait.GetNameText(),
-// IsBold = true,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.SubheadingFontSize,
-// };
-// topView.AddChidren(btnTitle);
-
-// 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(200),
-// Width = Application.GetRealWidth(120),
-// TextAlignment = TextAlignment.CenterRight,
-// TextColor = CSS_Color.MainColor,
-// TextSize = CSS_FontSize.TextFontSize,
-// TextID = StringId.Complete,
-// };
-// topView.AddChidren(btnConfrim);
-// int hei = 1;
-// foreach (var m in statusList)
-// {
-// var row = new FrameLayout()
-// {
-// Y = Application.GetRealHeight(50 * hei),
-// Height = Application.GetRealHeight(50),
-// };
-// optionBaseView.AddChidren(row);
-// if (statusList.Count > hei)
-// {
-// optionBaseView.AddChidren(new Button()
-// {
-// Gravity = Gravity.CenterHorizontal,
-// Y = row.Bottom,
-// Width = Application.GetRealWidth(343),
-// BackgroundColor = CSS_Color.DividingLineColor,
-// Height = 1,
-// });
-// }
-// hei++;
-
-// var btnChoose = new Button()
-// {
-// X = Application.GetRealWidth(303),
-// Gravity = Gravity.CenterVertical,
-// Width = Application.GetMinRealAverage(28),
-// Height = Application.GetMinRealAverage(28),
-// UnSelectedImagePath = "Public/ChooseIcon.png",
-// SelectedImagePath = "Public/ChooseOnIcon.png",
-
-// };
-// row.AddChidren(btnChoose);
-// if (trait.value == m)
-// {
-// lastButton = btnChoose;
-// btnChoose.IsSelected = true;
-// }
-// var btnPropertyTitle = new Button()
-// {
-// X = Application.GetRealWidth(16),
-// TextAlignment = TextAlignment.CenterLeft,
-// TextColor = CSS_Color.FirstLevelTitleColor,
-// TextSize = CSS_FontSize.TextFontSize,
-// Tag = m,
-// Text = trait.GetValueText(m)
-// };
-// row.AddChidren(btnPropertyTitle);
-
-// btnPropertyTitle.MouseUpEventHandler = (sender, e) => {
-// btnChoose.IsSelected = true;
-// if (lastButton != null)
-// {
-// lastButton.IsSelected = false;
-// }
-// lastButton = btnChoose;
-// lastData = btnPropertyTitle.Tag.ToString();
-// lastText = btnPropertyTitle.Text;
-// };
-// }
-
-
-
-
-// dialog.Show();
-
-// pView.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-
-// btnCancel.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// };
-// btnConfrim.MouseUpEventHandler = (sender, e) => {
-// dialog.Close();
-// trait.value = lastData;
-// //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ;
-// btn.Text = lastText;
-// };
-
-// }
-
-// #endregion
-
-// }
-//}
-
-
-
-
-
- using System;
+锘縰sing System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -1875,7 +36,10 @@
{
var temp = fc.status.Find((obj) => obj.key == ll.key);
if (temp != null)
+ {
ll.value = temp.value;
+ //ll.UintString = temp.UintString;
+ }
}
catch { }
}
@@ -2020,41 +184,56 @@
}
}
var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid);
-
- if (temp != null)
+
+ try
{
- //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;
- // }
- //}
- temp = sceneFunction;
- }
- else
- {
- scene.functions.Add(sceneFunction);
- }
- if (!string.IsNullOrEmpty(scene.userSceneId))
- {
- var result = scene.UpdateScene();
- if (result == DAL.Server.StateCode.SUCCESS)
+ if (temp != null)
{
- refreshAction();
- this.RemoveFromParent();
+ //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;
+ // }
+ //}
+ //temp = sceneFunction;
+ scene.functions.Remove(temp);
+ }
+ //else
+ {
+ scene.functions.Insert(0, sceneFunction);
+ }
+ if (!string.IsNullOrEmpty(scene.userSceneId))
+ {
+ var result = scene.UpdateScene();
+ if (result == DAL.Server.StateCode.SUCCESS)
+ {
+ refreshAction();
+ this.RemoveFromParent();
+ }
+ else
+ {
+ DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(result);
+ }
}
else
{
- DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(result);
+ try
+ {
+ refreshAction();
+ this.RemoveFromParent();
+ }
+ catch
+ {
+ MainPage.Log($"xxxxxx123");
+ }
}
}
- else
+ catch
{
- refreshAction();
- this.RemoveFromParent();
+ MainPage.Log($"xxxxxx1234");
}
};
@@ -2899,6 +1078,7 @@
if (pickerItems.Contains(trait.value + trait.GetUintString()))
{
selectItem = trait.value.ToString() + trait.GetUintString();
+ uIPickerView.setCurrentItems(pickerItems.IndexOf(selectItem),0,0);
}
dialog.Show();
@@ -3915,8 +2095,8 @@
void LoadEditDialog_FunctionPar(SceneFunctionStatus trait, Button btn,List<string> statusList)
{
Button lastButton = new Button();
- var lastData = "";
- var lastText = "";
+ var lastData = trait.value;
+ var lastText = btn.Text;
Dialog dialog = new Dialog();
if(DB_ResidenceData.Instance.GatewayType == 0)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
index 2f801c5..a1a754e 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
@@ -217,7 +217,7 @@
//function.SaveFunctionData(true);
};
- new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh);
+ new TopViewDiv(bodyView, Language.StringByID(StringId.EnergyMonitoring)).LoadTopView_FunctionTop(function, actionRefresh);
new System.Threading.Thread(() =>
{
DriverLayer.Control.Ins.SendReadCommand(function);
@@ -265,6 +265,11 @@
{
if (btnRunStatus == null)
return;
+ if (function.GetAttrState(FunctionAttributeKey.OnOff) == "off")
+ {
+ btnRunStatus.Text = "";
+ return;
+ }
var runStatus = function.GetAttrState("run_status");
if (Language.CurrentLanguage == "Chinese")
{
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
index bd0a8ba..8124d16 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
@@ -210,7 +210,7 @@
};
controlView.AddChidren(btnSwitch);
- new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh,false);
+ new TopViewDiv(bodyView, Language.StringByID(StringId.EnergyMonitoring)).LoadTopView_FunctionTop(function, actionRefresh,false);
new System.Threading.Thread(() =>
{
DriverLayer.Control.Ins.SendReadCommand(function);
@@ -258,6 +258,11 @@
{
if (btnRunStatus == null)
return;
+ if(function.GetAttrState(FunctionAttributeKey.OnOff) == "off")
+ {
+ btnRunStatus.Text = "";
+ return;
+ }
var runStatus = function.GetAttrState("run_status");
if (Language.CurrentLanguage == "Chinese")
{
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
index 495e602..0d4740a 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
@@ -83,10 +83,7 @@
public EnergyMainPage()
{
bodyView = this;
- energyList = FunctionList.List.GetEnergyList();
- var breaker = FunctionList.List.Functions.FindAll((obj) => obj.spk == SPK.AirSwitch);
- var energyBreker = breaker.FindAll((obj) => obj.GetAttribute("power") != null);
- energyList.AddRange(energyBreker);
+ energyList = FunctionList.List.GetEnergyList().FindAll((obj)=>obj.spk == SPK.AirSwitch || obj.spk == SPK.ElectricEnergy);
}
/// <summary>
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
index b05731e..f51e8a3 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
@@ -354,6 +354,7 @@
{
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
function.Control(d);
}
else
@@ -453,6 +454,7 @@
{
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
function.Control(d);
}
else
@@ -626,10 +628,10 @@
ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
};
framePickerBack.AddChidren(colorPicker);
- //if (function.trait_on_off.curValue.ToString() == "off")
- //{
- // colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
- //}
+ if (function.trait_on_off.curValue.ToString() == "off")
+ {
+ colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
+ }
//colorPicker.MouseDownEventHandler = (sender, e) => {
// MainPage.BasePageView.ScrollEnabled = false;
//};
@@ -675,11 +677,12 @@
colorPicker.MouseDownEventHandler += (sender, e) =>
{
pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
- if (pointIsRight == false)
+ if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false)
{
- //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
+ //pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
return;
}
+
//鏄剧ず鐧界偣
btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
@@ -694,8 +697,6 @@
//褰撻紶鏍囩偣涓嬩簨浠跺鐞�
colorPicker.MouseDownEventHandler(sender, e);
};
-
-
#region 浜害璋冭妭
var btnBrightnessText = new Button()
@@ -760,6 +761,7 @@
{
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
function.Control(d);
}
else
@@ -774,6 +776,22 @@
function.Control(d);
})
{ IsBackground = true }.Start();
+ }
+ }
+ if (e == 0)
+ {
+ if (function.trait_on_off.curValue.ToString() == "on")
+ {
+ function.SetAttrState(FunctionAttributeKey.OnOff, "off");
+ colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
+ }
+ }
+ else
+ {
+ if (function.trait_on_off.curValue.ToString() == "off")
+ {
+ function.SetAttrState(FunctionAttributeKey.OnOff, "on");
+ colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png";
}
}
};
@@ -796,10 +814,14 @@
if (btnSwitch.IsSelected)
{
dimmerBar.Progress = 100;
+ function.SetAttrState(FunctionAttributeKey.OnOff, "on");
+ colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png";
}
else
{
dimmerBar.Progress = 0;
+ function.SetAttrState(FunctionAttributeKey.OnOff, "off");
+ colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
}
};
#endregion
@@ -902,9 +924,7 @@
#endregion
-
heightMore = 70;
-
}
if (hadColorful)
@@ -986,8 +1006,6 @@
};
#endregion
-
-
}
--
Gitblit v1.8.0