| | |
| | | <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"> |
| | |
| | | <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" /> |
| | |
| | | 101=已分配 |
| | | 102=房间已经存在,添加失败。 |
| | | 103=是否要删除该房间? |
| | | 104=变化速度 |
| | | 104=变化时间 |
| | | 105=室内温度 |
| | | 106=空调 |
| | | 107=可视对讲 |
| | |
| | | 327=捕获场景 |
| | | 328=电影场景 |
| | | 329=普通 |
| | | 330=时间模式 |
| | | 330=自动模式 |
| | | 331=功率地热 |
| | | 332=地冷 |
| | | 333=功率地冷 |
| | |
| | | 101=已分配 |
| | | 102=房间已经存在,添加失败。 |
| | | 103=是否要删除该房间? |
| | | 104=变化速度 |
| | | 104=变化时间 |
| | | 105=室内温度 |
| | | 106=空调 |
| | | 107=可视对讲 |
| | |
| | | { |
| | | if (MainPage.InternetStatus == 0) |
| | | return; |
| | | //线程开始时间 |
| | | var beginTime = DateTime.MinValue; |
| | | |
| | | DownloadDataComplete = false; |
| | | |
| | |
| | | |
| | | 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; |
| | |
| | | |
| | | //===================读取逻辑列表========================== |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | } |
| | | /// <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> |
| | | /// 获取住宅下的成员账号 |
| | |
| | | /// 获取住宅网关分页 |
| | | /// </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> |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using Shared; |
| | | |
| | |
| | | /// </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 = ""; |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using Shared; |
| | | |
| | |
| | | /// 收藏场景 |
| | | /// </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> |
| | |
| | | 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; |
| | |
| | | } |
| | | else |
| | | { |
| | | Utlis.ShowTip(Shared.Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | return pack.Code; |
| | | } |
| | |
| | | /// <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(); |
| | |
| | | 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> |
| | | /// 属性名称显示文本 |
| | |
| | | } |
| | | string msg = function.name + Language.StringByID(StringId.CollectionCancelled); |
| | | LoadDeviceFunctionControlZone(); |
| | | function.SaveFunctionData(true); |
| | | function.CollectFunction(); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, true); |
| | | }; |
| | | } |
| | |
| | | btnCollectionIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollectionIcon.IsSelected = function.collect = !btnCollectionIcon.IsSelected; |
| | | function.SaveFunctionData(true); |
| | | function.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | 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(); |
| | | // } |
| | | //} |
| | | }; |
| | | } |
| | | |
| | |
| | | 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(); |
| | | }; |
| | | } |
| | | |
| | |
| | | btnCollection.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollection.IsSelected = aC.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | aC.SaveFunctionData(true); |
| | | aC.CollectFunction(); |
| | | }; |
| | | } |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | curtain.SaveFunctionData(true); |
| | | curtain.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | btnCollection.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | curtain.SaveFunctionData(true); |
| | | curtain.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | btnCollection.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | curtain.SaveFunctionData(true); |
| | | curtain.CollectFunction(); |
| | | }; |
| | | } |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = fan.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | fan.SaveFunctionData(true); |
| | | fan.CollectFunction(); |
| | | }; |
| | | } |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = socketFunction.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | socketFunction.SaveFunctionData(true); |
| | | socketFunction.CollectFunction(); |
| | | }; |
| | | } |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = tv.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | tv.SaveFunctionData(true); |
| | | tv.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | btnCollection.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollection.IsSelected = fh.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | fh.SaveFunctionData(true); |
| | | fh.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | /// <summary>
|
| | | /// 渐变时间修改
|
| | | /// </summary>
|
| | | DiyImageSeekBar barFadeTime;
|
| | | //DiyImageSeekBar barFadeTime;
|
| | | /// <summary>
|
| | | /// 色温的滑动控件
|
| | | /// </summary>
|
| | |
| | | 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,
|
| | |
| | | //色温
|
| | | 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;
|
| | |
| | | #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()
|
| | |
| | | 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) =>
|
| | | {
|
| | |
| | | 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();
|
| | |
| | | DriverLayer.Control.Ins.SendWriteCommand(light, d); barColorTemplatrue.Progress = 27;
|
| | | barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
|
| | | frameBack.Close();
|
| | | btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
|
| | | };
|
| | |
|
| | | //会客图标
|
| | |
| | | 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
|
| | |
| | | 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";
|
| | | };
|
| | |
|
| | | //阅读图标
|
| | |
| | | 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();
|
| | |
| | | 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; |
| | |
| | | /// </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>
|
| | |
| | | //设置自定义的文本 |
| | | 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>
|
| | |
| | | {
|
| | | btnCollection.MouseUpEventHandler += (sender, e) => {
|
| | | btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
|
| | | light.SaveFunctionData(true);
|
| | | light.CollectFunction();
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | 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>
|
| | |
| | | {
|
| | | btnSwitch.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | light.fadeTime = barFadeTime.Progress;
|
| | | //light.fadeTime = barFadeTime.Progress;
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | if (btnSwitch.IsSelected)
|
| | | {
|
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | light.SaveFunctionData(true); |
| | | light.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | 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 + "%"; |
| | | }; |
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | light.SaveFunctionData(true); |
| | | light.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | |
| | | 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!!"); |
| | | // } |
| | | //} |
| | | }; |
| | | } |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | light.SaveFunctionData(true); |
| | | light.CollectFunction(); |
| | | }; |
| | | } |
| | | |