From e1a8f2f7e4d850beedeb1469610b878c1427e976 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 15 十二月 2021 09:01:53 +0800
Subject: [PATCH] 更新

---
 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 1050 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 899 insertions(+), 151 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 4504b63..4973f51 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -10,25 +10,26 @@
     {
         FrameLayout bodyView;
         VerticalScrolViewLayout contentView;
+        Button btnOnText;
+        Button btnBrightnessText;
 
         Scene scene;
 
         Action refreshAction;
-        Function function;
-        public SceneFunctionInfoEditPage(Scene s,Function fc,Action action)
+        SceneFunction sceneFunction;
+        public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action)
         {
             bodyView = this;
             scene = s;
-            function = fc;
+            sceneFunction = fc;
             refreshAction = action;
         }
-
 
         public void LoadPage()
         {
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
 
-            new TopViewDiv(bodyView, function.name).LoadTopView();
+            new TopViewDiv(bodyView, sceneFunction.localFunction.name).LoadTopView();
 
             contentView = new VerticalScrolViewLayout()
             {
@@ -38,38 +39,74 @@
             };
             bodyView.AddChidren(contentView);
 
-            //鍔犺浇寮�鍏砇ow
-            LoadFunctionRow(function.trait_on_off);
+            LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff));
 
-            switch (function.functionType)
+            foreach (var attr in sceneFunction.status)
             {
-                case FunctionType.AC:
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "set_temperature"));
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "mode"));
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "fan"));
-                    break;
-                case FunctionType.FloorHeating:
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "set_temperature"));
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "mode"));
-                    break;
-                case FunctionType.Curtain:
-                    //鏃犳搷浣�
-                    break;
-                case FunctionType.MotorCurtain:
-                case FunctionType.RollingShutter:
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "percent"));
-                    break;
-                case FunctionType.Relay:
-                    //鏃犳搷浣�
-                    break;
-                case FunctionType.Dimmer:
-                case FunctionType.RGB:
-                    LoadFunctionRow(function.function.Find((obj) => obj.key == "brightness"));
-                    break;
+                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;
+                }
             }
 
-            //鍔犺浇寤舵椂Row
-            LoadDelayRow();
+            //鍔犺浇寮�鍏砇ow
+            //LoadFunctionRow(sceneFunction.localFunction.trait_on_off);
+            //switch (sceneFunction.localFunction.functionType)
+            //{
+            //    case SPK.AcStandard:
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp"));
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode"));
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "fan"));
+            //        break;
+            //    case SPK.FloorHeatStandard:
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp"));
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode"));
+            //        break;
+            //    case SPK.CurtainSwitch:
+            //        //鏃犳搷浣�
+            //        break;
+            //    case SPK.CurtainTrietex:
+            //    case SPK.CurtainRoller:
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent"));
+            //        break;
+            //    case SPK.LightSwitch:
+            //        //鏃犳搷浣�
+            //        break;
+            //    case SPK.LightDimming:
+            //    case SPK.LightRGB:
+            //        LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness"));
+            //        break;
+            //}
+
+            if (DB_ResidenceData.Instance.GatewayType != 0)
+            {
+                //鍔犺浇寤舵椂Row
+                LoadDelayRow();
+            }
 
             var bottomView = new FrameLayout()
             {
@@ -98,17 +135,43 @@
 
             btnConfrim.MouseUpEventHandler = (sender, e) =>
             {
-                var temp = scene.sceneFunctionList.Find((obj) => obj.sid == function.sid);
-                if (temp!=null)
+                var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid);
+                //if (sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness) != null)
+                //{
+                //    try
+                //    {
+                //        //涓�绔彛涓嶆敮鎸佸紑鍏冲�间笌浜害鍊间竴璧峰鐞嗭紝闇�瑕佸皢寮�鍏冲�肩Щ闄ゆ帀
+                //        sceneFunction.status.Remove(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff));
+                //    }
+                //    catch { }
+                //}
+                
+                if (temp != null)
                 {
-                    temp = function;
+                    temp = sceneFunction;
                 }
                 else
                 {
-                    scene.sceneFunctionList.Add(function);
+                    scene.functions.Add(sceneFunction);
                 }
-                refreshAction();
-                this.RemoveFromParent();
+                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();
+                }
             };
         }
 
@@ -116,9 +179,9 @@
         /// <summary>
         /// 鍔犺浇鍔熻兘Row
         /// </summary>
-        void LoadFunctionRow(FunctionAttributes trait)
+        void LoadFunctionRow(SceneFunctionStatus sceneStatus)
         {
-            if (trait == null)
+            if (sceneStatus == null)
                 return;
             #region Row code
             var row = new FrameLayout()
@@ -127,11 +190,20 @@
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
             contentView.AddChidren(row);
-            if (trait.key != "on_off")
+
+
+            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 });
             }
-            Button btnBrightnessRight = new Button()
+            else
+            {
+                if(sceneStatus.value == "stop")
+                {
+                    sceneStatus.value = "on";
+                }
+            }
+            Button btnRight = new Button()
             {
                 X = Application.GetRealWidth(339),
                 Gravity = Gravity.CenterVertical,
@@ -139,7 +211,61 @@
                 Height = Application.GetMinRealAverage(16),
                 UnSelectedImagePath = "Public/Right.png",
             };
-            row.AddChidren(btnBrightnessRight);
+            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()
             {
@@ -147,9 +273,34 @@
                 TextAlignment = TextAlignment.CenterRight,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Text = trait.GetCurValueText() + trait.uintString
+                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()
             {
@@ -157,62 +308,60 @@
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
-                Text = trait.name_text
+                Text = sceneStatus.GetNameText()
             };
             row.AddChidren(btnFunctionName);
             btnFunctionName.MouseUpEventHandler = (sender, e) =>
             {
-                switch (trait.key)
+                switch (sceneStatus.key)
                 {
-                    case "on_off":
-                        LoadEditDialog_OnOff(trait, btnFunctionText);
+                    case FunctionAttributeKey.OnOff:
+                        LoadEditDialog_OnOff(sceneStatus, btnFunctionText);
                         break;
-                    case "brightness":
-                        LoadEditDialog_Percent(trait, btnFunctionText);
+                    case FunctionAttributeKey.Brightness:
+                        LoadEditDialog_Percent(sceneStatus, btnFunctionText);
                         break;
-                    //case "color":
-                    //    break;
-                    case "mode":
-                        LoadEditDialog_FunctionPar(trait, btnFunctionText);
+                    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 "fan":
-                        LoadEditDialog_FunctionPar(trait, btnFunctionText);
+                    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 "set_temperature":
-                        LoadEditDialog_Temp(trait, btnFunctionText);
+                    case FunctionAttributeKey.SetTemp:
+                        LoadEditDialog_Temp(sceneStatus, btnFunctionText);
                         break;
-                    case "delay":
+                    case FunctionAttributeKey.FadeTime:
+
                         break;
                     case "cct":
+                        LoadEditDialog_CCT(sceneStatus, btnFunctionText);
                         break;
-                    //case "fade_time":
-                    case "percent":
-                        LoadEditDialog_Percent(trait, btnFunctionText);
+                    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 "lock":
-                        //case "ico":
-                        //case "swing":
-                        //case "set_ point":
-                        //case "pm25":
-                        //case "volume":
-                        //case "vol_step":
-                        //case "source":
-                        //case "treble":
-                        //case "bass":
-                        //case "playlist":
-                        //case "song_name":
-                        //case "current_status":
-                        //case "enable":
-                        //case "lux":
-                        //case "adjust_value":
-                        //case "range":
-                        //case "humidity":
-                        //case "type":
-                        //case "state":
-                        //case "sensitivity":
-                        //case "pm25value":
+                    case FunctionAttributeKey.Percent:
+                        LoadEditDialog_Percent(sceneStatus, btnFunctionText);
+                        break;
                 }
-                //LoadEditDialog_Temp(trait, btnFunctionText);
             };
 
             #endregion
@@ -250,7 +399,7 @@
                 TextAlignment = TextAlignment.CenterRight,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Text = scene.delayText
+                Text = new Scene() { delay = sceneFunction.delay }.GetDelayText()
             };
             delayRow.AddChidren(btnDelayInfo);
 
@@ -266,14 +415,22 @@
 
 
             btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => {
-                new PublicAssmebly().SetSceneDelayDialog(function, btnDelayInfo);
+                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 灞炴�ч�夋嫨寮圭獥
@@ -282,7 +439,7 @@
         /// </summary>
         /// <param name="function"></param>
         /// <param name="btn"></param>
-        void LoadEditDialog_OnOff(FunctionAttributes trait, Button btn)
+        void LoadEditDialog_OnOff(SceneFunctionStatus trait, Button btn)
         {
             Dialog dialog = new Dialog();
 
@@ -320,7 +477,7 @@
                 SelectedTextColor = CSS_Color.MainColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
                 TextID = StringId.On,
-                IsSelected = function.trait_on_off.curValue.ToString() == "on"
+                IsSelected = trait.value.ToString() == "on"
             };
             optionView.AddChidren(btnOn);
 
@@ -334,7 +491,7 @@
                 SelectedTextColor = CSS_Color.MainColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
                 TextID = StringId.OFF,
-                IsSelected = function.trait_on_off.curValue.ToString() == "off"
+                IsSelected = trait.value.ToString() == "off"
             };
             optionView.AddChidren(btnOff);
 
@@ -363,13 +520,43 @@
             };
             btnOn.MouseUpEventHandler = (sender, e) => {
                 dialog.Close();
-                trait.curValue = "on";
-                btn.Text = trait.GetCurValueText() + trait.uintString;
+                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.curValue = "off";
-                btn.Text= trait.GetCurValueText() + trait.uintString;
+                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() + "%";
+                }
             };
 
         }
@@ -379,8 +566,12 @@
         /// </summary>
         /// <param name="function"></param>
         /// <param name="btn"></param>
-        void LoadEditDialog_Temp(FunctionAttributes trait, Button btn)
+        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)
             {
@@ -446,33 +637,19 @@
                 Height = Application.GetRealHeight(210),
                 Radius = (uint)Application.GetRealWidth(12),
             };
-            if(trait!=null)
+            for (int i = trait.min; i <= trait.max; i += 1)
             {
-                if (trait.data_type == "float")
-                {
-                    for (double i = trait.min; i <= trait.max; i += 0.5)
-                    {
-                        pickerItems.Add(i.ToString() + trait.uintString);
-                    }
-                }
-                else
-                {
-                    for (int i = trait.min; i <= trait.max; i += 1)
-                    {
-                        pickerItems.Add(i.ToString() + trait.uintString);
-                    }
-                }
-            }else
-            {
-                for (int i = 16; i <= 32; i += 1)
-                {
-                    pickerItems.Add(i.ToString() + trait.uintString);
-                }
+                pickerItems.Add(i.ToString() + trait.GetUintString());
             }
             uIPickerView.setNPicker(pickerItems, null, null);
             optionBaseView.AddChidren(uIPickerView);
-            uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.curValue.ToString()), 4, 5);
-            string selectItem = trait.curValue.ToString() + trait.uintString;
+            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();
 
@@ -489,18 +666,18 @@
             btnConfrim.MouseUpEventHandler = (sender, e) => {
                 dialog.Close();
                 btn.Text = selectItem;
-                trait.curValue = selectItem.Replace(trait.uintString,"");
+                //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(FunctionAttributes trait, Button btn)
+        void LoadEditDialog_Percent(SceneFunctionStatus trait, Button btn)
         {
             if (trait == null)
             {
@@ -539,13 +716,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.name_text,
+                Text = trait.GetNameText(),
                 IsBold = true,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
@@ -573,8 +749,6 @@
             };
             topView.AddChidren(btnConfrim);
 
-
-
             Button btnMinusSignIcon = new Button()
             {
                 X = Application.GetRealWidth(26),
@@ -598,7 +772,7 @@
                 ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                 ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                 MaxValue = 100,
-                Progress = trait.curValue.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32( trait.curValue),
+                Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")),
                 SeekBarPadding = Application.GetRealWidth(20),
             };
             optionBaseView.AddChidren(controlBar);
@@ -613,39 +787,64 @@
             };
             optionBaseView.AddChidren(btnPlusSgnIcon);
 
-            btnMinusSignIcon.MouseUpEventHandler = (sender, e) => {
+            btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
+            {
                 controlBar.Progress--;
             };
-            btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => {
+            btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
+            {
                 controlBar.Progress++;
             };
 
-
             dialog.Show();
-            pView.MouseUpEventHandler = (sender, e) => {
+            pView.MouseUpEventHandler = (sender, e) =>
+            {
                 dialog.Close();
             };
 
-            btnCancel.MouseUpEventHandler = (sender, e) => {
+            btnCancel.MouseUpEventHandler = (sender, e) =>
+            {
                 dialog.Close();
             };
-            btnConfrim.MouseUpEventHandler = (sender, e) => {
+            btnConfrim.MouseUpEventHandler = (sender, e) =>
+            {
                 dialog.Close();
-                trait.curValue = controlBar.Progress;
-                btn.Text = trait.curValue + trait.uintString;
+                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>
-        void LoadEditDialog_FunctionPar(FunctionAttributes trait, Button btn)
+        /// <param name="function"></param>
+        /// <param name="btn"></param>
+        void LoadEditDialog_CCT(SceneFunctionStatus trait, Button btn)
         {
-            Button lastButton = new Button();
-            var lastData = "";
-            var lastText = "";
+            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()
@@ -656,10 +855,558 @@
 
             var optionBaseView = new FrameLayout()
             {
-                Y = Application.GetRealHeight(579 - 50 * trait.value.Count),
+                Y = Application.GetRealHeight(456 - 60),
                 Gravity = Gravity.CenterHorizontal,
                 Width = Application.GetRealWidth(343),
-                Height = Application.GetRealHeight(50 * trait.value.Count + 50),
+                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()
+            {
+                Width = Application.GetRealWidth(320),
+                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()
+            {
+                Width = Application.GetRealWidth(320),
+                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,
@@ -682,7 +1429,7 @@
                 Gravity = Gravity.CenterHorizontal,
                 TextAlignment = TextAlignment.Center,
                 Width = Application.GetRealWidth(100),
-                Text = trait.name_text,
+                Text = trait.GetNameText(),
                 IsBold = true,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
@@ -710,7 +1457,7 @@
             };
             topView.AddChidren(btnConfrim);
             int hei = 1;
-            foreach (var m in trait.value)
+            foreach (var m in statusList)
             {
                 var row = new FrameLayout()
                 {
@@ -718,7 +1465,7 @@
                     Height = Application.GetRealHeight(50),
                 };
                 optionBaseView.AddChidren(row);
-                if (trait.value.Count > hei)
+                if (statusList.Count > hei)
                 {
                     optionBaseView.AddChidren(new Button()
                     {
@@ -742,7 +1489,7 @@
 
                 };
                 row.AddChidren(btnChoose);
-                if (trait.curValue.ToString() == m)
+                if (trait.value == m)
                 {
                     lastButton = btnChoose;
                     btnChoose.IsSelected = true;
@@ -784,7 +1531,8 @@
             };
             btnConfrim.MouseUpEventHandler = (sender, e) => {
                 dialog.Close();
-                trait.curValue = lastData;
+                trait.value = lastData;
+                //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ;
                 btn.Text = lastText;
             };
 

--
Gitblit v1.8.0