JLChen
2020-12-23 58beee272e47fdbf814e0c8fe625e09c5b844d4d
Merge branch 'NewFilePath' into CJL
32个文件已修改
817 ■■■■■ 已修改文件
HDL-ON_Android/Assets/Language.ini 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/DB_ResidenceData.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | 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/BindingResidence/BindingResidencePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | 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/4-PersonalCenter/MyQRCodePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | 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 | 历史
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
@@ -55,7 +55,7 @@
            return result;
        }
        public bool DownloadDataComplete = false;
        public bool DownloadDataComplete = true;
        /// <summary>
        /// 下载数据
        /// </summary>
@@ -63,19 +63,25 @@
        {
            if (MainPage.InternetStatus == 0)
                return;
            //线程开始时间
            var endTime = DateTime.Now.AddSeconds(6);
            MainPage.Log($"开始同步云端数据");
            DownloadDataComplete = false;
            var waitPage = new Loading();
            MainPage.BaseView.AddChidren(waitPage);
            waitPage.Start();
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            string code = StateCode.SUCCESS;
            new System.Threading.Thread(() => {
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                MainPage.Log($"进入读取云端数据线程");
                //===================刷新Token=======================
                code = Ins.HttpRequest.RefreshToken();
                if(code != StateCode.SUCCESS)
                if (code != StateCode.SUCCESS)
                {
                    MainPage.Log($"刷新token失败");
                    return;
@@ -191,7 +197,7 @@
                    var pack = Ins.HttpRequest.GetSceneList();
                    if (pack.Code == StateCode.SUCCESS)
                    {
                        MainPage.Log($"读取场景数据成功");//:\r\n{pack.Data.ToString()}");
                        MainPage.Log($"读取场景数据成功");
                        var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
                        if (sceneList != null)
                        {
@@ -237,18 +243,64 @@
                    //===================读取逻辑列表==========================
                    UI.UI2.Intelligence.Automation.MainView.GetLogicList();
                }catch(Exception ex)
                }
                catch (Exception ex)
                {
                    MainPage.Log($"数据初始化失败:{ex.Message}");
                }
                finally
                {
                    Application.RunOnMainThread(() => {
                    Application.RunOnMainThread(() =>
                    {
                        MainPage.Log($"结束读取云端数据线程");
                        endTime = DateTime.MinValue;
                        DownloadDataComplete = true;
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                    });
                }
            });
            downloadDataThread.IsBackground = true;
            downloadDataThread.Priority = System.Threading.ThreadPriority.Highest;
            downloadDataThread.Start();
            //网络卡顿,终止下载线程
            new System.Threading.Thread(() =>
            {
                try
                {
                    while (endTime > DateTime.Now)
                    {
                        if (DownloadDataComplete)
                        {
                            break;
                        }
                        System.Threading.Thread.Sleep(100);
                    }
                    if (!DownloadDataComplete)
                    {
                        //downloadDataThread.Abort();
                    }
                    DownloadDataComplete = true;
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                    });
                    //初始化数据
                    //SpatialInfo.CurrentSpatial.Clear();
                }
                catch { }
                finally
                {
                    #region 读取本地数据
                    //读取音乐信息
                    UI.Music.A31MusicModel.ReadMusicStates();
                    //搜索网关
                    DriverLayer.Control.Ins.SearchLoaclGateway();
                    #endregion
                }
            })
            { IsBackground = true }.Start();
        }
HDL_ON/DAL/DriverLayer/Control.cs
@@ -241,7 +241,11 @@
        {
            if (Ins.IsRemote || DB_ResidenceData.Instance.GatewayType == 1)
            {
                ControlAProtocolScene(scene);
                new System.Threading.Thread(() =>
                {
                    ControlAProtocolScene(scene);
                })
                { IsBackground = true }.Start();
            }
            else
            {
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -503,7 +503,7 @@
                                UserInfo.Current.SaveUserInfo();
                                Action action = () =>
                                {
                                    MainPage.GoUserPage();
                                    MainPage.GoUserPage(true);
                                };
                                new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action);
                            });
@@ -553,11 +553,11 @@
        /// <summary>
        /// 获取刷新当前住宅的网关列表
        /// </summary>
        public void GetHomeGatewayList()
        public string GetHomeGatewayList()
        {
            try
            {
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return;
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return "";
                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
                var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
@@ -571,7 +571,7 @@
                            if (mHomeGatewayRes.Count > 0)
                            {
                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
                                if(mHomeGatewayRes[0].gatewayStatus)
                                if (mHomeGatewayRes[0].gatewayStatus)
                                {
                                    //DriverLayer.Control.Ins.IsRemote = true;
                                    DriverLayer.Control.Ins.GatewayOnline = true;
@@ -581,7 +581,7 @@
                                    DriverLayer.Control.Ins.GatewayOnline = false;
                                }
                                DB_ResidenceData.Instance.SaveResidenceData();
                                return;
                                return revertObj.Code;
                            }
                        }
                        //其余情况清空网关信息
@@ -593,12 +593,34 @@
                {
                    //提示错误
                }
                return revertObj.Code;
            }
            catch
            {
                return "";
            }
        }
        /// <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>
@@ -387,7 +391,7 @@
        /// <summary>
        /// 取消收藏场景
        /// </summary>
        public const string Api_Post_CancelCollectScene = "/home-wisdom/app/scene/cancelcollect";
        public const string Api_Post_CancelCollectScene = "/home-wisdom/app/scene/cancelCollect";
        #endregion
        #region Kaede -- 房间接口____________________________
HDL_ON/Entity/DB_ResidenceData.cs
@@ -121,6 +121,8 @@
            instance = null;
            ins_OidList = null;
            HomeGateway = null;
            //重置网关状态
            DriverLayer.Control.Ins.GatewayOnline = false;
            SpatialInfo.CurrentSpatial.Clear();
            FunctionList.List.Clear();
            
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/BindingResidence/BindingResidencePage.cs
@@ -126,7 +126,7 @@
                //调用On原来的方法,刷新住宅列表及其缓存
                pm.GetHomePager();
                //跳转页面----
                MainPage.GoUserPage(false, () =>
                MainPage.GoUserPage(true, false, () =>
                {
                    //显示欢迎回家的弹窗界面
                    var form = new WellcomToHomeForm();
HDL_ON/UI/MainPage.cs
@@ -119,7 +119,7 @@
                        //{ IsBackground = true }.Start();
                        Common.ApiUtlis.Ins.DownloadData();
                        GoUserPage(true);
                        GoUserPage(false,true);
                    }
                }
            }
@@ -153,7 +153,7 @@
        /// </summary>
        /// <param name="isFirstOpen">如果是第一次启动 检测校验密码</param>
        /// <param name="pageShowEvent">主页显示之后触发的事件(没有住宅的话,则不会触发)</param>
        public static void GoUserPage(bool isFirstOpen = false, Action pageShowEvent = null)
        public static void GoUserPage(bool downloadData , bool isFirstOpen = false, Action pageShowEvent = null)
        {
            //加载Loading效果
            var waitPage = new Loading();
@@ -227,11 +227,11 @@
                    MainPage.Log($"GoUserPage : {ex.Message}");
                }finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        ///初始化app数据
                        InitializationData();
                    });
                    //Application.RunOnMainThread(() =>
                    //{
                    //    ///初始化app数据
                    //    Common.ApiUtlis.Ins.DownloadData();
                    //});
                }
            }).Start();
        }
@@ -239,7 +239,7 @@
        /// <summary>
        /// 初始化app所需要的数据
        /// </summary>
        public static void InitializationData()
        public static void InitializationData1()
        {
            //new System.Threading.Thread(() =>
            //{
@@ -276,12 +276,6 @@
            //})
            //{ IsBackground = true }.Start();
            #region 读取本地数据
            //读取音乐信息
            UI.Music.A31MusicModel.ReadMusicStates();
            //搜索网关
            DriverLayer.Control.Ins.SearchLoaclGateway();
            #endregion
        }
        /// <summary>
HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -598,7 +598,7 @@
                            if (verAccount == etPassword.Text.Trim())
                            {
                                //跳转页面----
                                MainPage.GoUserPage();
                                MainPage.GoUserPage(true);
                                return;
                            }
                        });
@@ -630,7 +630,7 @@
                            Application.RunOnMainThread(() =>
                            {
                                //跳转页面----
                                MainPage.GoUserPage();
                                MainPage.GoUserPage(true);
                            });
                        }
                        else
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/4-PersonalCenter/MyQRCodePage.cs
@@ -156,7 +156,7 @@
                        Application.RunOnMainThread(() =>
                        {
                            //跳转页面----
                            MainPage.GoUserPage(false, () =>
                            MainPage.GoUserPage(true, false, () =>
                            {
                                //显示欢迎回家的弹窗界面
                                var form = new WellcomToHomeForm();
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
old mode 100755 new mode 100644
@@ -186,47 +186,10 @@
            }
            DB_ResidenceData.Instance.CurrentRegion = homeTemp;
            DB_ResidenceData.Instance.SaveResidenceData();
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new System.Threading.Thread(() =>
            {
                try
                {
                    DB_ResidenceData.Instance.EixtAccount();
                    //刷新一次住宅网关
                    new HttpServerRequest().GetHomeGatewayList();
                    Application.RunOnMainThread(() =>
                    {
                        btnCurResidenceName.Text = DB_ResidenceData.Instance.CurrentRegion.Name;
                        //重置网关状态
                        DriverLayer.Control.Ins.GatewayOnline = false;
                    });
                    //搜索网关
                    DriverLayer.Control.Ins.SearchLoaclGateway();
                }
                catch (Exception ex)
                {
                    Application.RunOnMainThread(() =>
                    {
                        new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.OperationFailed),
                                   Language.StringByID(StringId.Close)).Show();
                    });
                    MainPage.Log(ex.Message);
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        MainPage.InitializationData();
                    });
                }
            })
            { IsBackground = true }.Start();
            btnCurResidenceName.Text = DB_ResidenceData.Instance.CurrentRegion.Name;
            DB_ResidenceData.Instance.EixtAccount();
            //刷新住宅数据
            Common.ApiUtlis.Ins.DownloadData();
        }
        #endregion
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();
            };
        }