| | |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | UpdateStatus (ac); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 3, ac.Power, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 3, ac.Power, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { 3, ac.Power, ac.LoopID }); |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, ac.Power, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, ac.Power, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power); |
| | |
| | | } |
| | | UpdateStatus (ac); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { modeKey, ac.SetTemperature, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { modeKey, ac.SetTemperature, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { modeKey, ac.SetTemperature, ac.LoopID }); |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power && obj.UniversalFanSpeed == ac.SetFanSpeed && obj.UniversalTemp == ac.SetTemperature); |
| | |
| | | } |
| | | UpdateStatus (ac); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { modeKey, ac.SetTemperature, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { modeKey, ac.SetTemperature, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { modeKey, ac.SetTemperature, ac.LoopID }); |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power && obj.UniversalFanSpeed == ac.SetFanSpeed && obj.UniversalTemp == ac.SetTemperature); |
| | |
| | | } |
| | | UpdateStatus (ac); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 6, ac.SetMode, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 6, ac.SetMode, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { 6, ac.SetMode, ac.LoopID }); |
| | | |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power && obj.UniversalFanSpeed == ac.SetFanSpeed && obj.UniversalTemp == ac.SetTemperature); |
| | |
| | | UpdateStatus (ac); |
| | | acM.UpdataACHostModeIcon (ac.SetMode, btnModeIcon); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 6, ac.SetMode, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 6, ac.SetMode, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { 6, ac.SetMode, ac.LoopID }); |
| | | |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power && obj.UniversalFanSpeed == ac.SetFanSpeed && obj.UniversalTemp == ac.SetTemperature); |
| | |
| | | //acM.UpdataACHostWindIcon (ac.SetFanSpeed, btnWindIcon); |
| | | UpdateStatus (ac); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 5, ac.SetFanSpeed, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 5, ac.SetFanSpeed, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { 5, ac.SetFanSpeed, ac.LoopID }); |
| | | |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power && obj.UniversalFanSpeed == ac.SetFanSpeed && obj.UniversalTemp == ac.SetTemperature); |
| | |
| | | |
| | | UpdateStatus (ac); |
| | | if (ac.Type == DeviceType.ACPanel) { |
| | | Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 5, ac.SetFanSpeed, ac.LoopID }); |
| | | //Control.ControlBytesSend (Command.InstructionPanelKey, ac.SubnetID, ac.DeviceID, new byte [] { 5, ac.SetFanSpeed, ac.LoopID }); |
| | | SendControlACPanel (ac, new byte [] { 5, ac.SetFanSpeed, ac.LoopID }); |
| | | |
| | | } else if (ac.Type == DeviceType.ACDevice || ac.Type == DeviceType.ACInfrared || ac.Type == DeviceType.HVAC) { |
| | | Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | //Control.ControlBytesSend (Command.SetACMode, ac.SubnetID, ac.DeviceID, new [] { ac.LoopID, ac.TemperatureMode, ac.IndoorTemperature, ac.CoolTemperature, ac.HeatTemperature, ac.AutoTemperature, ac.ChuShiTemperature, ac.RealModeAndFanSpeed, btnACSwitch.IsSelected ? (byte)1 : (byte)0, ac.SetMode, ac.SetFanSpeed, ac.SetTemperature, ac.ShaoFanMode }); |
| | | ac.Power = btnACSwitch.IsSelected ? (byte)1 : (byte)0; |
| | | SendControlHVAC (ac); |
| | | } else if (ac.Type == DeviceType.CustomAC) { |
| | | var acCommon = ac as CustomAC; |
| | | var controlCommand = acCommon.customACControlLists.Find ((obj) => obj.UniversalModeType == ac.Power && obj.UniversalFanSpeed == ac.SetFanSpeed && obj.UniversalTemp == ac.SetTemperature); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 空调控制,带返回结果 |
| | | /// </summary> |
| | | /// <param name="mAcData"></param> |
| | | void SendControlACPanel (AC mAcData, byte[] sendBytes) |
| | | { |
| | | MainPage.Loading.Start ("Sending..."); |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | byte [] returnBytes = Control.ControlBytesSendHasReturn (Command.InstructionPanelKey, mAcData.SubnetID, mAcData.DeviceID, sendBytes); |
| | | |
| | | Application.RunOnMainThread (() => { |
| | | if (returnBytes == null) { |
| | | new Alert ("", mAcData.Name + ErrorCode.ControlFailure, "Close").Show (); |
| | | } |
| | | MainPage.Loading.Hide (); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空调控制,带返回结果 |
| | | /// </summary> |
| | | /// <param name="mAcData"></param> |
| | | void SendControlHVAC (AC mAcData) |
| | | { |
| | | |
| | | MainPage.Loading.Start ("Sending..."); |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | byte [] returnBytes = Control.ControlBytesSendHasReturn (Command.SetACMode, mAcData.SubnetID, mAcData.DeviceID, new [] { mAcData.LoopID, mAcData.TemperatureMode, mAcData.IndoorTemperature, mAcData.CoolTemperature, mAcData.HeatTemperature, mAcData.AutoTemperature, mAcData.ChuShiTemperature, mAcData.RealModeAndFanSpeed, mAcData.Power, mAcData.SetMode, mAcData.SetFanSpeed, mAcData.SetTemperature, mAcData.ShaoFanMode }); |
| | | |
| | | Application.RunOnMainThread (() => { |
| | | if (returnBytes == null) { |
| | | new Alert ("", mAcData.Name + ErrorCode.ControlFailure, "Close").Show (); |
| | | } |
| | | MainPage.Loading.Hide (); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |