From 22c5c030f2262b6a9d6840bf3b5196b7ab2d4dd5 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 10 三月 2020 14:31:53 +0800 Subject: [PATCH] 2020-03-10 1.替换最新控件库,增加无网络监听,Loading效果优化。 2.电能插座修复点亮统计个数问题。 3 .定时检测网关是否在线,发送CheckGateway间隔为10S,收到主题刷新该时间,重置发送次数,发送次数到达3次以上,则判定网关为离线状态。 4.远程重复增加为3次,重发后等待5s才回调结果。 5.修复去掉普通继电器读电能操作。 6.读状态间隔缩短为200ms。 --- Crabtree/SmartHome/UI/SimpleControl/Phone/Fan/SystemFan.cs | 32 ++++++++++++++++++++++++++++---- 1 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Fan/SystemFan.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Fan/SystemFan.cs index a150f55..0d82b45 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Fan/SystemFan.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Fan/SystemFan.cs @@ -144,8 +144,9 @@ btnWindSpeedAdd.IsSelected = true; if (fanModule.WindSpeed <8) { fanModule.WindSpeed++; - Control.ControlBytesSend (Command.SetSingleLight, fanModule.SubnetID, fanModule.DeviceID, - new byte [] { fanModule.LoopID,fanModule.WindSpeed }); + //Control.ControlBytesSend (Command.SetSingleLight, fanModule.SubnetID, fanModule.DeviceID, + // new byte [] { fanModule.LoopID,fanModule.WindSpeed }); + SendControlFan (fanModule, fanModule.WindSpeed); btnWindSpeedText.Text = fanModule.WindSpeed.ToString (); IO.FileUtils.SaveEquipmentMessage (fanModule, fanModule.LoopID.ToString ()); } @@ -158,8 +159,9 @@ btnWindSpeedReduce.IsSelected = true; if (fanModule.WindSpeed >0) { fanModule.WindSpeed--; - Control.ControlBytesSend (Command.SetSingleLight, fanModule.SubnetID, fanModule.DeviceID, - new byte [] { fanModule.LoopID,fanModule.WindSpeed }); + //Control.ControlBytesSend (Command.SetSingleLight, fanModule.SubnetID, fanModule.DeviceID, + //new byte [] { fanModule.LoopID,fanModule.WindSpeed }); + SendControlFan (fanModule, fanModule.WindSpeed); btnWindSpeedText.Text = fanModule.WindSpeed.ToString (); IO.FileUtils.SaveEquipmentMessage (fanModule, fanModule.LoopID.ToString ()); } @@ -172,5 +174,27 @@ //SystemMiddle.hideBottom (); } + /// <summary> + /// //2020-02-10 甯﹁繑鍥炵粨鏋滅殑椋庢墖鎺у埗 + /// </summary> + /// <param name="mFanModule"></param> + /// <param name="sendByte"></param> + void SendControlFan (FanModule mFanModule, byte sendByte) + { + + MainPage.Loading.Start ("Sending..."); + + System.Threading.Tasks.Task.Run (() => { + byte [] returnBytes = Control.ControlBytesSendHasReturn (Command.SetSingleLight, mFanModule.SubnetID, mFanModule.DeviceID, new byte [] { mFanModule.LoopID, sendByte }); + //byte [] returnBytes = Control.ControlBytesSendHasReturn (Command.SetSingleLight, fanModule.SubnetID, fanModule.DeviceID, new byte [] { fanModule.LoopID, fanModule.Switch }); + Application.RunOnMainThread (() => { + if (returnBytes == null) { + new Alert ("", mFanModule.Name + ErrorCode.ControlFailure, "Close").Show (); + } + MainPage.Loading.Hide (); + }); + }); + } + } } \ No newline at end of file -- Gitblit v1.8.0