wei
2020-12-23 f345087dbefecef9146fdb13481cb9ee3320d576
20201223-2

初始化数据优化
26个文件已修改
737 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Scene.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs 130 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,15 +1,12 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/1-HomePage/HomePage.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" Line="411" Column="18" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs" />
      <File FileName="HDL_ON/Entity/Room.cs" />
      <File FileName="HDL_ON/Entity/FunctionList.cs" />
      <File FileName="HDL_ON/UI/MainPage.cs" Line="210" Column="52" />
      <File FileName="HDL_ON/UI/UI2/UserPage.cs" Line="130" Column="34" />
      <File FileName="HDL_ON/UI/UI2/UserPageBLL.cs" Line="21" Column="33" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="384" Column="34" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="273" Column="88" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="147" Column="24" />
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="275" Column="64" />
      <File FileName="HDL_ON/Entity/Room.cs" Line="442" Column="34" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs" Line="62" Column="51" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
@@ -18,26 +15,31 @@
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="DriverLayer" expanded="True" />
                <Node name="Mqtt" expanded="True" />
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True" />
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True">
                    <Node name="HomePage.cs" selected="True" />
                  </Node>
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="2-Classification" expanded="True" />
                  <Node name="3-Intelligence" expanded="True">
                    <Node name="Automation" expanded="True">
                      <Node name="LogicView" expanded="True" />
                    </Node>
                    <Node name="Scene" expanded="True" />
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="AboutOn" expanded="True" />
                  <Node name="4-PersonalCenter" expanded="True" />
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="ChooseRoomPageBLL.cs" selected="True" />
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_Android" expanded="True">
              <Node name="Assets" expanded="True" />
            </Node>
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Resources" expanded="True">
                <Node name="zh-Hans.lproj" expanded="True" />
HDL-ON_Android/Assets/Language.ini
@@ -123,7 +123,7 @@
101=已分配
102=房间已经存在,添加失败。
103=是否要删除该房间?
104=变化速度
104=变化时间
105=室内温度
106=空调
107=可视对讲
@@ -349,7 +349,7 @@
327=捕获场景
328=电影场景
329=普通
330=时间模式
330=自动模式
331=功率地热
332=地冷
333=功率地冷
HDL-ON_iOS/Resources/Language.ini
@@ -123,7 +123,7 @@
101=已分配
102=房间已经存在,添加失败。
103=是否要删除该房间?
104=变化速度
104=变化时间
105=室内温度
106=空调
107=可视对讲
HDL_ON/Common/ApiUtlis.cs
@@ -63,6 +63,8 @@
        {
            if (MainPage.InternetStatus == 0)
                return;
            //线程开始时间
            var beginTime = DateTime.MinValue;
            DownloadDataComplete = false;
@@ -72,10 +74,11 @@
            string code = StateCode.SUCCESS;
            new System.Threading.Thread(() => {
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                //===================刷新Token=======================
                code = Ins.HttpRequest.RefreshToken();
                if(code != StateCode.SUCCESS)
                if (code != StateCode.SUCCESS)
                {
                    MainPage.Log($"刷新token失败");
                    return;
@@ -237,20 +240,51 @@
                    //===================读取逻辑列表==========================
                    UI.UI2.Intelligence.Automation.MainView.GetLogicList();
                }catch(Exception ex)
                }
                catch (Exception ex)
                {
                    MainPage.Log($"数据初始化失败:{ex.Message}");
                }
                finally
                {
                    Application.RunOnMainThread(() => {
                    Application.RunOnMainThread(() =>
                    {
                        beginTime = DateTime.Now;
                        DownloadDataComplete = true;
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                    });
                }
            })
            { IsBackground = true }.Start();
            });
            downloadDataThread.IsBackground = true;
            downloadDataThread.Start();
            //网络卡顿,终止下载线程
            new System.Threading.Thread(() => {
                while (beginTime.AddSeconds(6) > DateTime.Now)
                {
                    if(DownloadDataComplete)
                    {
                        break;
                    }
                    System.Threading.Thread.Sleep(100);
                }
                if (DownloadDataComplete)
                {
                    //下载完成初始化数据
                    SpatialInfo.CurrentSpatial.Clear();
                }
                else
                {
                    downloadDataThread.Abort();
                    Application.RunOnMainThread(() => {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                    });
                }
            }) { IsBackground = true }.Start();
        }
    }
}
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -599,6 +599,27 @@
            }
        }
        /// <summary>
        /// 获取网关信息
        /// </summary>
        public string GetGatewayInfo()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGatewayInfo, jsonString);
            if (revertObj.Code == StateCode.SUCCESS)
            {
                var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
                if (mHomeGatewayRes != null)
                {
                    DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes;
                    DB_ResidenceData.Instance.SaveResidenceData();
                }
            }
            return revertObj.Code;
        }
        /// <summary>
        /// 获取住宅下的成员账号
HDL_ON/DAL/Server/NewAPI.cs
@@ -166,6 +166,10 @@
        /// 获取住宅网关分页
        /// </summary>
        public const string API_POST_GetGatewayList = "/home-wisdom/app/gateway/getGatewayList";
        /// <summary>
        /// 获取网关信息
        /// </summary>
        public const string Api_Post_GetGatewayInfo = "/home-wisdom/app/gateway/info";
        ///// <summary>
        ///// 解绑绑网关到住宅
        ///// </summary>
HDL_ON/Entity/Function/Function.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using HDL_ON.Common;
using HDL_ON.DAL.Server;
using HDL_ON.DriverLayer;
using Shared;
@@ -207,6 +209,66 @@
        /// </summary>
        public int fixedSerialNumber = int.MaxValue;
        /// <summary>
        /// 收藏功能
        /// </summary>
        public void CollectFunction()
        {
            var result = "";
            //var waitPage = new Loading();
            new System.Threading.Thread(() =>
            {
                if (collect)
                {
                    result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code;
                }
                else
                {
                    result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code;
                }
                //提示错误
                if (result != StateCode.SUCCESS)
                {
                    Application.RunOnMainThread(() =>
                    {
                        collect = !collect;
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 编辑功能绑定房间信息
        /// </summary>
        public void EditBindRoomInfo(string roomId)
        {
            var result = "";
            new System.Threading.Thread(() =>
            {
                if (collect)
                {
                    result = ApiUtlis.Ins.HttpRequest.BindDeviceToRoom(new List<string>() { deviceId }, new List<string>() { roomId }).Code;
                }
                else
                {
                    result = ApiUtlis.Ins.HttpRequest.UnbindDeviceToRoom(deviceId,roomId);
                }
                //提示错误
                if (result != StateCode.SUCCESS)
                {
                    Application.RunOnMainThread(() =>
                    {
                        collect = !collect;
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        public string GetBusId()
        {
            string busId = "";
@@ -261,22 +323,22 @@
        {
            if (upSevser)
            {
                var pm = new DAL.Server.HttpServerRequest();
                var pm = new HttpServerRequest();
                var pack = pm.UpdataDevcieInfo(this);
                if (pack.Code == DAL.Server.StateCode.SUCCESS)
                if (pack.Code == StateCode.SUCCESS)
                {
                    var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
                    Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                    FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                }
                else
                {
                    Utlis.ShowTip(Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code);
                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                }
            }
            else
            {
                var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
                Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                FileUtlis.Files.WriteFileByBytes(savePath, ssd);
            }
        }
HDL_ON/Entity/Function/Scene.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using HDL_ON.Common;
using HDL_ON.DAL.Server;
using Shared;
@@ -279,19 +280,30 @@
        /// 收藏场景
        /// </summary>
        /// <returns></returns>
        public string CollectScene()
        public void CollectScene()
        {
            var pm = new HttpServerRequest();
            if (this.collect)
            var result = StateCode.SUCCESS;
            new System.Threading.Thread(() =>
            {
                var revPack = pm.CollectScene(this.userSceneId);
                return revPack;
            }
            else
            {
                var revPack = pm.CancelCollectScene(this.userSceneId);
                return revPack;
            }
                if (collect)
                {
                    result = ApiUtlis.Ins.HttpRequest.CollectScene(userSceneId);
                }
                else
                {
                    result = ApiUtlis.Ins.HttpRequest.CancelCollectScene(userSceneId);
                }
                //提示错误
                if (result != StateCode.SUCCESS)
                {
                    Application.RunOnMainThread(() =>
                    {
                        collect = !collect;
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
HDL_ON/Entity/FunctionList.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using HDL_ON.Common;
using HDL_ON.DAL;
using HDL_ON.DAL.Server;
using Shared;
@@ -371,7 +372,7 @@
            }
            else
            {
                Utlis.ShowTip(Shared.Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code);
                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
            }
            return pack.Code;
        }
@@ -647,7 +648,7 @@
        /// <summary>
        /// 添加场景
        /// </summary>
        public string AddScene(Scene scene,out Scene result)
        public string AddScene(Scene scene, out Scene result)
        {
            Scene tempScene = null;
            var pm = new HttpServerRequest();
@@ -657,13 +658,46 @@
                var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString());
                tempScene = sceneList.Find((obj) => obj.sid == scene.sid);
                var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene));
                Common.FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd);
                FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd);
                result = tempScene;
            }
            result = tempScene;
            else
            {
                result = tempScene;
            }
            return revPack.Code;
        }
        #endregion
        #region 收藏功能
        /// <summary>
        /// 收藏场景
        /// </summary>
        public string CollectScene(Scene scene)
        {
            var result = "";
            if (scene.collect)
            {
                result = ApiUtlis.Ins.HttpRequest.CollectDevice(scene.userSceneId).Code;
            }
            else
            {
                result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(scene.userSceneId).Code;
            }
            //提示错误
            if (result != StateCode.SUCCESS)
            {
                IMessageCommon.Current.ShowErrorInfoAlter(result);
            }
            return result;
        }
        #endregion
        #region 功能文本相关
        /// <summary>
        /// 属性名称显示文本
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -98,7 +98,7 @@
                }
                string msg = function.name + Language.StringByID(StringId.CollectionCancelled);
                LoadDeviceFunctionControlZone();
                function.SaveFunctionData(true);
                function.CollectFunction();
                new PublicAssmebly().TipMsgAutoClose(msg, true);
            };
        }
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -66,7 +66,7 @@
            btnCollectionIcon.MouseUpEventHandler += (sender, e) =>
            {
                btnCollectionIcon.IsSelected = function.collect = !btnCollectionIcon.IsSelected;
                function.SaveFunctionData(true);
                function.CollectFunction();
            };
        }
@@ -139,32 +139,33 @@
                    Control.Ins.SendWriteCommand(light, d);
                };
                dimmerControlBar.OnProgressChangedEvent = (sender, e) => {
                    light.brightness = e;
                    light.trait_on_off.curValue = e > 0 ? "on" : "off";
                    dimmerControlBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                    //light.brightness = e;
                    //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                    if (e == 0 || e == 100)
                    {
                        //Control.Send(CommandType_A.write, light);
                        System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                        d.Add("brightness", light.brightness.ToString());
                        Control.Ins.SendWriteCommand(light, d);
                    }
                    else
                    {
                        var tm = (DateTime.Now - light.refreshTime).TotalMilliseconds;
                        Console.WriteLine("skip time "+tm);
                        if (300 < tm)
                        {
                            light.refreshTime = DateTime.Now;
                            new System.Threading.Thread(() =>
                            {
                                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                                d.Add("brightness", light.brightness.ToString());
                                Control.Ins.SendWriteCommand(light, d);
                            })
                            { IsBackground = true }.Start();
                        }
                    }
                    //if (e == 0 || e == 100)
                    //{
                    //    //Control.Send(CommandType_A.write, light);
                    //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    //    d.Add("brightness", light.brightness.ToString());
                    //    Control.Ins.SendWriteCommand(light, d);
                    //}
                    //else
                    //{
                    //    var tm = (DateTime.Now - light.refreshTime).TotalMilliseconds;
                    //    Console.WriteLine("skip time "+tm);
                    //    if (300 < tm)
                    //    {
                    //        light.refreshTime = DateTime.Now;
                    //        new System.Threading.Thread(() =>
                    //        {
                    //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    //            d.Add("brightness", light.brightness.ToString());
                    //            Control.Ins.SendWriteCommand(light, d);
                    //        })
                    //        { IsBackground = true }.Start();
                    //    }
                    //}
                };
            }
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -823,17 +823,39 @@
                        return;
                    }
                }
                var result = FunctionList.List.AddScene(scene,out scene);
                if (result == StateCode.SUCCESS)
                var waitPage = new Loading();
                MainPage.BaseView.AddChidren(waitPage);
                waitPage.Start(Language.StringByID(StringId.PleaseWait));
                new System.Threading.Thread(() =>
                {
                    FunctionList.List.scenes.Add(scene);
                    backAction();
                    RemoveFromParent();
                }
                else
                {
                    IMessageCommon.Current.ShowErrorInfoAlter(result);
                }
                    try
                    {
                        var serverScene = new Scene();
                        var result = FunctionList.List.AddScene(scene, out serverScene);
                        Application.RunOnMainThread(() =>
                        {
                            if (result == StateCode.SUCCESS)
                            {
                                FunctionList.List.scenes.Add(scene);
                                backAction();
                                RemoveFromParent();
                            }
                            else
                            {
                                IMessageCommon.Current.ShowErrorInfoAlter(result);
                            }
                        });
                    }
                    catch { }
                    finally
                    {
                        Application.RunOnMainThread(() => {
                            waitPage.Hide();
                            waitPage.RemoveFromParent();
                        });
                    }
                })
                { IsBackground = true, Priority = ThreadPriority.AboveNormal }.Start();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -66,7 +66,7 @@
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = aC.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                aC.SaveFunctionData(true);
                aC.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
old mode 100755 new mode 100644
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -63,7 +63,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                curtain.SaveFunctionData(true);
                curtain.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -135,7 +135,7 @@
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                curtain.SaveFunctionData(true);
                curtain.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -135,7 +135,7 @@
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                curtain.SaveFunctionData(true);
                curtain.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
old mode 100755 new mode 100644
@@ -51,7 +51,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = fan.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                fan.SaveFunctionData(true);
                fan.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs
old mode 100755 new mode 100644
@@ -49,7 +49,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = socketFunction.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                socketFunction.SaveFunctionData(true);
                socketFunction.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
old mode 100755 new mode 100644
@@ -29,7 +29,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = tv.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                tv.SaveFunctionData(true);
                tv.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -68,7 +68,7 @@
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = fh.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                fh.SaveFunctionData(true);
                fh.CollectFunction();
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -37,7 +37,7 @@
        /// <summary>
        /// 渐变时间修改
        /// </summary>
        DiyImageSeekBar barFadeTime;
        //DiyImageSeekBar barFadeTime;
        /// <summary>
        /// 色温的滑动控件
        /// </summary>
@@ -141,9 +141,9 @@
            dimmerBar = new WaveSeekBarOn()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(74 + 16),
                Width = Application.GetRealWidth(142 - 40),
                Height = Application.GetRealHeight(222 - 16 - 16),
                Y = Application.GetRealHeight(108),
                Width = Application.GetRealWidth(142 - 16 -16),
                Height = Application.GetRealHeight(222),
                BorderColor = 0x00000000,
                CornerRadius = Application.GetRealWidth(20),
                BorderWidth = 0,
@@ -177,7 +177,7 @@
            //色温
            var btnTempClolor = new Button();
            btnTempClolor.X = Application.GetRealWidth(35);
            btnTempClolor.Y = Application.GetRealHeight(306);
            btnTempClolor.Y = Application.GetRealHeight(306 +60);
            btnTempClolor.Width = Application.GetRealWidth(224);
            btnTempClolor.Height = Application.GetRealHeight(21);
            btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
@@ -239,63 +239,63 @@
            #endregion
            #region 渐变时间调节
            var btnGradualChangeText = new Button()
            {
                X = Application.GetRealWidth(35),
                Y = Application.GetRealHeight(385),
                Width = Application.GetRealWidth(224),
                Height = Application.GetRealHeight(21),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.SpeedOfChange,
            };
            controlView.AddChidren(btnGradualChangeText);
            //var btnGradualChangeText = new Button()
            //{
            //    X = Application.GetRealWidth(35),
            //    Y = Application.GetRealHeight(385),
            //    Width = Application.GetRealWidth(224),
            //    Height = Application.GetRealHeight(21),
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.FirstLevelTitleColor,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    TextID = StringId.SpeedOfChange,
            //};
            //controlView.AddChidren(btnGradualChangeText);
            var btnGradualChangeMinValuesText = new Button()
            {
                X = Application.GetRealWidth(35),
                Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
                Width = Application.GetRealWidth(22),
                Height = Application.GetRealHeight(21),
                Text = "0s",
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            controlView.AddChidren(btnGradualChangeMinValuesText);
            //var btnGradualChangeMinValuesText = new Button()
            //{
            //    X = Application.GetRealWidth(35),
            //    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(22),
            //    Height = Application.GetRealHeight(21),
            //    Text = "0s",
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.PromptingColor1,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //};
            //controlView.AddChidren(btnGradualChangeMinValuesText);
            barFadeTime = new DiyImageSeekBar()
            {
                X = btnGradualChangeMinValuesText.Right,
                Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
                Width = Application.GetRealWidth(210),
                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,
                ProgressBarUnitSring = "s",
                MaxValue = 10,
                Progress = light.fadeTime,
                SeekBarPadding = Application.GetRealWidth(20),
            };
            controlView.AddChidren(barFadeTime);
            //barFadeTime = new DiyImageSeekBar()
            //{
            //    X = btnGradualChangeMinValuesText.Right,
            //    Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(210),
            //    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,
            //    ProgressBarUnitSring = "s",
            //    MaxValue = 10,
            //    Progress = light.fadeTime,
            //    SeekBarPadding = Application.GetRealWidth(20),
            //};
            //controlView.AddChidren(barFadeTime);
            var btnGradualChangeMaxValuesText = new Button()
            {
                X = barFadeTime.Right,
                Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
                Width = Application.GetRealWidth(35),
                Height = Application.GetRealHeight(21),
                Text = "10s",
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            controlView.AddChidren(btnGradualChangeMaxValuesText);
            //var btnGradualChangeMaxValuesText = new Button()
            //{
            //    X = barFadeTime.Right,
            //    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(35),
            //    Height = Application.GetRealHeight(21),
            //    Text = "10s",
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.PromptingColor1,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //};
            //controlView.AddChidren(btnGradualChangeMaxValuesText);
            #endregion
            btnSwitch = new Button()
@@ -314,9 +314,9 @@
            btnShortcut = new Button();
            btnShortcut.X = Application.GetRealWidth(104);
            btnShortcut.Y = btnSwitch.Y;
            btnShortcut.Width = Application.GetRealWidth(40);
            btnShortcut.Height = Application.GetRealWidth(40);
            btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatrueQuick.png";
            btnShortcut.Width = Application.GetRealWidth(36);
            btnShortcut.Height = Application.GetRealWidth(36);
            btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
            controlView.AddChidren(btnShortcut);
            btnShortcut.MouseUpEventHandler += (sender, e) =>
            {
@@ -396,6 +396,7 @@
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
            };
            //温馨 2700k
            var btnCozy = new Button();
@@ -420,6 +421,7 @@
                DriverLayer.Control.Ins.SendWriteCommand(light, d); barColorTemplatrue.Progress = 27;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
            };
            //会客图标
@@ -440,6 +442,7 @@
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            };
            //会客 3000k
@@ -463,6 +466,7 @@
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            };
            //阅读图标
@@ -483,6 +487,7 @@
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            };
            //阅读 6500k
            var btnRead = new Button();
@@ -505,6 +510,7 @@
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            };
            btnCozy.IsSelected = false;
            btnCozyIcon.IsSelected = false;
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -64,11 +64,11 @@
        /// </summary>
        void LoadEvet_ChangeFadeTime()
        {
            barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
            {
                light.fadeTime = e;
                light.SaveFunctionData(true);
            };
            //barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
            //{
            //    light.fadeTime = e;
            //    light.SaveFunctionData(true);
            //};
        }
        /// <summary>
@@ -85,13 +85,22 @@
                        //设置自定义的文本
                        barColorTemplatrue.SetCustomText(value * 100 + "K");
                        light.Attr_CCT.curValue = value * 100;
                        System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                        d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                        Control.Ins.SendWriteCommand(light, d);
                        //System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                        //d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                        //Control.Ins.SendWriteCommand(light, d);
                    });
                    System.Threading.Thread.Sleep(200);
                    //System.Threading.Thread.Sleep(200);
                }).Start();
            };
            barColorTemplatrue.OnStopTrackingTouchEvent = (sender, value) =>
            {
                light.Attr_CCT.curValue = value * 100;
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                Control.Ins.SendWriteCommand(light, d);
            };
        }
        /// <summary>
@@ -101,7 +110,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.SaveFunctionData(true);
                light.CollectFunction();
            };
        }
@@ -116,46 +125,48 @@
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
                onDimmerBar = false;
                light.brightness = dimmerBar.Progress;
                //Control.Send(CommandType_A.write, light);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                Control.Ins.SendWriteCommand(light, d);
                light.fadeTime = barFadeTime.Progress;
                //light.fadeTime = barFadeTime.Progress;
            };
            dimmerBar.OnProgressChangedEvent = (sender, e) => {
                light.fadeTime = 0;
                if (!btnSwitch.IsSelected)
                {
                    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                }
                btnSwitch.IsSelected = e > 0 ? true : false;
                light.brightness = e;
                light.trait_on_off.curValue = e > 0 ? "on" : "off";
            dimmerBar.OnProgressChangedEvent = (sender, e) =>
            {
                //light.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
                //    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //}
                //btnSwitch.IsSelected = e > 0 ? true : false;
                //light.brightness = e;
                //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                if (e == 0 || e == 100)
                {
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                    Control.Ins.SendWriteCommand(light, d);
                }
                else
                {
                    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                    {
                        light.refreshTime = DateTime.Now;
                        new System.Threading.Thread(() =>
                        {
                            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                            Control.Ins.SendWriteCommand(light, d);
                        })
                        { IsBackground = true }.Start();
                    }
                }
                //if (e == 0 || e == 100)
                //{
                //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //    Control.Ins.SendWriteCommand(light, d);
                //}
                //else
                //{
                //    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                //    {
                //        light.refreshTime = DateTime.Now;
                //        new System.Threading.Thread(() =>
                //        {
                //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //            Control.Ins.SendWriteCommand(light, d);
                //        })
                //        { IsBackground = true }.Start();
                //    }
                //}
                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40);
                btnBrightnessText.Text = light.brightness + "%";
            };
        }
        /// <summary>
@@ -165,7 +176,7 @@
        {
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                light.fadeTime = barFadeTime.Progress;
                //light.fadeTime = barFadeTime.Progress;
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                if (btnSwitch.IsSelected)
                {
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -77,7 +77,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.SaveFunctionData(true);
                light.CollectFunction();
            };
        }
@@ -98,38 +98,38 @@
                Control.Ins.SendWriteCommand(light, d);
                light.fadeTime = barFadeTime.Progress;
            };
            dimmerBar.OnProgressChangedEvent = (sender, e) => {
                light.fadeTime = 0;
                if (!btnSwitch.IsSelected)
                {
                    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                }
                btnSwitch.IsSelected = e > 0 ? true : false;
                light.brightness = e;
                light.trait_on_off.curValue = e > 0 ? "on" : "off";
                if (e == 0 || e == 100)
                {
                    //Control.Send(CommandType_A.write, this.light);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                    Control.Ins.SendWriteCommand(light, d);
                }
                else
                {
                    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                    {
                        light.refreshTime = DateTime.Now;
                        new System.Threading.Thread(() =>
                        {
                            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                            Control.Ins.SendWriteCommand(light, d);
                        })
                        { IsBackground = true }.Start();
                    }
                }
            //20201223 删除滑动发送命令,防止控件跳动
            dimmerBar.OnProgressChangedEvent = (sender, e) =>
            {
                //light.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
                //    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //}
                //btnSwitch.IsSelected = e > 0 ? true : false;
                //light.brightness = e;
                //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                //if (e == 0 || e == 100)
                //{
                //    //Control.Send(CommandType_A.write, this.light);
                //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //    Control.Ins.SendWriteCommand(light, d);
                //}
                //else
                //{
                //    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                //    {
                //        light.refreshTime = DateTime.Now;
                //        new System.Threading.Thread(() =>
                //        {
                //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //            Control.Ins.SendWriteCommand(light, d);
                //        })
                //        { IsBackground = true }.Start();
                //    }
                //}
                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40);
                btnBrightnessText.Text = light.brightness + "%";
            };
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -128,7 +128,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.SaveFunctionData(true);
                light.CollectFunction();
            };
        }
@@ -153,40 +153,40 @@
                light.fadeTime = barFadeTime.Progress;
            };
            dimmerBar.OnProgressChangedEvent = (sender, e) => {
                light.fadeTime = 0;
                if (!btnSwitch.IsSelected)
                {
                    dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                }
                btnSwitch.IsSelected = e > 0 ? true : false;
                light.brightness = e;
                light.trait_on_off.curValue = e > 0 ? "on" : "off";
                //light.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
                //    dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                //}
                //btnSwitch.IsSelected = e > 0 ? true : false;
                //light.brightness = e;
                //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                if (e == 0 || e == 100)
                {
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                    Control.Ins.SendWriteCommand(light, d);
                }
                else
                {
                    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                    {
                        light.refreshTime = DateTime.Now;
                        new System.Threading.Thread(() =>
                        {
                            //Control.Send(CommandType_A.write, light);
                            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                            Control.Ins.SendWriteCommand(light, d);
                        })
                        { IsBackground = true }.Start();
                    }
                    else
                    {
                        MainPage.Log("skip dimmer control!!");
                    }
                }
                //if (e == 0 || e == 100)
                //{
                //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //    Control.Ins.SendWriteCommand(light, d);
                //}
                //else
                //{
                //    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                //    {
                //        light.refreshTime = DateTime.Now;
                //        new System.Threading.Thread(() =>
                //        {
                //            //Control.Send(CommandType_A.write, light);
                //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //            Control.Ins.SendWriteCommand(light, d);
                //        })
                //        { IsBackground = true }.Start();
                //    }
                //    else
                //    {
                //        MainPage.Log("skip dimmer control!!");
                //    }
                //}
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
old mode 100755 new mode 100644
@@ -48,7 +48,7 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.SaveFunctionData(true);
                light.CollectFunction();
            };
        }