| | |
| | | try |
| | | { |
| | | ShowFunction vv = ShowFunction.Light; |
| | | switch (function.spk) |
| | | if (SPK.ElectricalSpkList().Contains(function.spk)) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | vv = ShowFunction.FloorHeating; |
| | | break; |
| | | case SPK.AcStandard: |
| | | vv = ShowFunction.AC; |
| | | break; |
| | | case SPK.CurtainRoller: |
| | | case SPK.CurtainShades: |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | vv = ShowFunction.Curtain; |
| | | break; |
| | | case SPK.LightCCT: |
| | | case SPK.LightDimming: |
| | | case SPK.LightRGB: |
| | | case SPK.LightSwitch: |
| | | vv = ShowFunction.Light; |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ClothesHanger: |
| | | vv = ShowFunction.Electric; |
| | | break; |
| | | vv = ShowFunction.Electric; |
| | | } |
| | | else if (SPK.FhSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.FloorHeating; |
| | | } |
| | | else if (SPK.AcSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.AC; |
| | | } |
| | | else if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.Curtain; |
| | | } |
| | | else if (SPK.LightSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.Light; |
| | | } |
| | | else if (SPK.AirFreshSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.FreshAir; |
| | | } |
| | | UpdataFunctionOnCount(vv, function.spk); |
| | | UpdataCloseAllButton(function); |
| | |
| | | break; |
| | | case ShowFunction.Electric: |
| | | btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case ShowFunction.FreshAir: |
| | | btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | } |
| | | if (btn.Tag.ToString() == functionCategory + "_onCount") |
| | |
| | | { |
| | | try |
| | | { |
| | | //全开全关 |
| | | //if (DB_ResidenceData.Instance.GatewayType == 0 && !Control.Ins.IsRemote) |
| | | //休眠时间(ms) |
| | | int sleepTime = 100; |
| | | if(DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | sleepTime = 200; |
| | | } |
| | | if (Control.Ins.GatewayOnline_Local) |
| | | { |
| | | switch (functionCategory) |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.FloorHeating: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.Light: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.Electric: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.FreshAir: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |