| | |
| | | return; |
| | | } |
| | | updataTime = DateTime.Now; |
| | | bodyView.arcBar.IsOffline = bodyView.aC.trait_on_off.curValue.ToString() != "on"; |
| | | //bodyView.arcBar.IsOffline = bodyView.aC.trait_on_off.curValue.ToString() != "on"; |
| | | //bodyView.btnSwitch.IsSelected = uAc.trait_on_off.curValue.ToString() == "on"; |
| | | //if (uAc.refreshTime.AddMilliseconds(500) < DateTime.Now) |
| | | //{ |
| | | // bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue)); |
| | | //} |
| | | //bodyView.arcBar.ThumbImagePath = uAc.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | //bodyView.arcBar.IsClickable = uAc.trait_on_off.curValue.ToString() == "on"; |
| | | bodyView.btnTemp.Text = uAc.trait_temp.curValue.ToString(); |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(uAc.trait_IndoorTemp.curValue)) + "°C"; |
| | | bodyView.btnMode.UnSelectedImagePath = uAc.curModeImage; |
| | | bodyView.btnWindSpeed.UnSelectedImagePath = uAc.curFanImage; |
| | | bodyView.btnSwitch.IsSelected = uAc.trait_on_off.curValue.ToString() == "on"; |
| | | if (uAc.refreshTime.AddMilliseconds(500) < DateTime.Now) |
| | | bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue)); |
| | | if (uAc.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue)); |
| | | bodyView.arcBar.IsOffline = false; |
| | | bodyView.btnSwitch.IsSelected = true; |
| | | bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | | if (uAc.trait_mode.curValue.ToString() == "fan") |
| | | { |
| | | bodyView.arcBar.IsClickable = false; |
| | | } |
| | | else |
| | | { |
| | | bodyView.arcBar.IsClickable = true; |
| | | } |
| | | } |
| | | bodyView.arcBar.ThumbImagePath = uAc.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | bodyView.arcBar.IsClickable = uAc.trait_on_off.curValue.ToString() == "on"; |
| | | |
| | | else |
| | | { |
| | | bodyView.arcBar.IsOffline = true; |
| | | bodyView.btnSwitch.IsSelected = false; |
| | | bodyView.arcBar.IsClickable = false; |
| | | bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | } |
| | | |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (aC.trait_on_off.curValue.ToString() == "off") |
| | | if (aC.trait_on_off.curValue.ToString() == "off" || aC.trait_mode.curValue.ToString() == "fan") |
| | | { |
| | | return; |
| | | } |
| | | var temp = Convert.ToInt32(aC.trait_temp.curValue); |
| | | if (temp < 17) |
| | | if (temp <= aC.trait_temp.min) |
| | | { |
| | | return; |
| | | } |
| | |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (aC.trait_on_off.curValue.ToString() == "off") |
| | | if (aC.trait_on_off.curValue.ToString() == "off" || aC.trait_mode.curValue.ToString() == "fan") |
| | | { |
| | | return; |
| | | } |
| | | var temp = Convert.ToInt32(aC.trait_temp.curValue); |
| | | if (temp > 31) |
| | | if (temp >= aC.trait_temp.max) |
| | | { |
| | | return; |
| | | } |
| | |
| | | btnMode.UnSelectedImagePath = aC.curModeImage; |
| | | //Control.Send(CommandType_A.write, aC); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | btnMode.UnSelectedImagePath = btn1.UnSelectedImagePath; |
| | | d.Add(FunctionAttributeKey.Mode, curMode); |
| | | Control.Ins.SendWriteCommand(aC, d); |
| | | dialog.Close(); |
| | | if (aC.trait_mode.curValue.ToString() == "fan") |
| | | { |
| | | bodyView.arcBar.IsClickable = false; |
| | | } |
| | | else |
| | | { |
| | | bodyView.arcBar.IsClickable = true; |
| | | } |
| | | }; |
| | | btn1.MouseUpEventHandler = eventHandler1; |
| | | btn2.MouseUpEventHandler = eventHandler1; |
| | |
| | | /// </summary> |
| | | void LoadEvent_ChangeFan(Dialog dialog, FrameLayout dialogView, Button btn1, Button btn2, string curFan) |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | EventHandler<MouseEventArgs> closeDialogEvent = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | |
| | | btn1.IsSelected = btn2.IsSelected = true; |
| | | aC.trait_fan.curValue = curFan; |
| | | btnWindSpeed.UnSelectedImagePath = aC.curFanImage; |
| | | //Control.Send(CommandType_A.write, aC); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.FanSpeed, curFan); |
| | | Control.Ins.SendWriteCommand(aC, d); |
| | | btnWindSpeed.UnSelectedImagePath = btn1.UnSelectedImagePath; |
| | | dialog.Close(); |
| | | }; |
| | | btn1.MouseUpEventHandler = eventHandler1; |
| | | btn2.MouseUpEventHandler = eventHandler1; |
| | | dialogView.MouseUpEventHandler = eventHandler; |
| | | dialogView.MouseUpEventHandler = closeDialogEvent; |
| | | } |
| | | } |
| | | } |