| | |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshAir() |
| | | { |
| | | bodyView.btnTempValues.Text = MainPage.cityInfo.temperature == null ? "--" : MainPage.cityInfo.temperature + "°"; |
| | | bodyView.btnHumidityValues.Text = MainPage.cityInfo.humidity == null ? "--" : MainPage.cityInfo.humidity + "%"; |
| | | bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25; |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.btnTempValues.Text = MainPage.cityInfo.temperature == null ? "--" : MainPage.cityInfo.temperature + "°"; |
| | | bodyView.btnHumidityValues.Text = MainPage.cityInfo.humidity == null ? "--" : MainPage.cityInfo.humidity + "%"; |
| | | bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 确认连接状态 |
| | | /// </summary> |
| | | public static void LoadEvent_CheckLinkStatus() |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (Control.Ins.GatewayOnline) |
| | | { |
| | | if (Control.Ins.IsRemote) |
| | | { |
| | | bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote; |
| | | } |
| | | else |
| | | { |
| | | bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | if (view.Tag.ToString() == function.sid) |
| | | { |
| | | var state = function.trait_on_off.value.ToString() == "on"; |
| | | var state = function.trait_on_off.curValue.ToString() == "on"; |
| | | for (int i = 0; i < view.ChildrenCount; i++) |
| | | { |
| | | if (view.GetChildren(i).GetType() == typeof(Button)) |
| | |
| | | { |
| | | string msg = function.name + Language.StringByID(StringId.AlreadyOpened); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, true); |
| | | Control.ins.ControlScene(function as Scene); |
| | | Control.Ins.ControlScene(function as Scene); |
| | | }; |
| | | btnCoverd.MouseUpEventHandler = eventHandler; |
| | | btnName.MouseUpEventHandler = eventHandler; |
| | |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.value = btnSwitch.IsSelected ? "on" : "off"; |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.value.ToString()); |
| | | Control.ins.SendWriteCommand(function, d); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = false; |
| | | curtain.trait_on_off.value = "off"; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off",curtain.trait_on_off.value.ToString()); |
| | | Control.ins.SendWriteCommand(curtain, d); |
| | | d.Add("on_off",curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | btnOpen.MouseDownEventHandler = (sender, e) => |
| | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnOpen.IsSelected = false; |
| | | curtain.trait_on_off.value = "on"; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.value.ToString()); |
| | | Control.ins.SendWriteCommand(curtain, d); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | } |
| | | |