| | |
| | | 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 ()); |
| | | } |
| | |
| | | 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 ()); |
| | | } |
| | |
| | | //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 (); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |