| | |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = device.trait_on_off.curValue.ToString() == "on" |
| | | IsSelected = device.trait_on_off.state.ToString() == "on" |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnSwitch); |
| | | |
| | |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | | } |
| | |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off") |
| | | if (device.trait_on_off.state.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | device.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off"; |
| | | if (device.trait_on_off.state.ToString() == "on") |
| | | { |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | | btnSwitch.IsSelected = true; |
| | |
| | | arcBar.IsOffline = true; |
| | | } |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | } |
| | |
| | | /// </summary> |
| | | private void RefreshFormStatu() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | Application.RunOnMainThread((Action)(() => |
| | | { |
| | | btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | if (device.trait_on_off.state.ToString() == "on") |
| | | { |
| | | arcBar.IsOffline = false; |
| | | btnSwitch.IsSelected = true; |
| | |
| | | arcBar.IsClickable = false; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | } |
| | | }); |
| | | })); |
| | | } |
| | | |
| | | #endregion |