| | |
| | | var temp = (int)Convert.ToDouble(setTempTemp); |
| | | if (temp <= 0) |
| | | { |
| | | //默认值改成16,2022年06月10日10:03:19 成甫要求的 |
| | | //默认值改成16 |
| | | temp = 16; |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | } |
| | |
| | | if (setTempAttr.curValue.ToString().Contains(".")) |
| | | { |
| | | btnTemp.Text = setTempAttr.curValue.ToString().Split(".")[0]; |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | btnTemp.Text = setTempAttr.curValue.ToString(); |
| | | } |
| | |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "°C", |
| | | Text = acFunction.GetTempUnitString(device), |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTempUint); |
| | | |
| | |
| | | Y = btnTemp.Bottom, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(30), |
| | | Text = Language.StringByID(StringId.Indoor) + " 20°C", |
| | | Text = Language.StringByID(StringId.Indoor) + " 20" + acFunction.GetTempUnitString(device), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.TopCenter, |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = setTempAttr.min.ToString(), |
| | | TextSize = 12, |
| | | TextColor = 0xFFC0C7D4, |
| | | }; |
| | | setTempView.AddChidren(btnMinTemp); |
| | | |
| | |
| | | #endif |
| | | btnTempUint.X = btnTemp.Right; |
| | | }; |
| | | setTempBar.OnStopTrackingTouchEvent = (sender,e) =>{ |
| | | setTempBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | temp = e; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); |
| | | if (setTempAttr.step == "0.5") |
| | | { |
| | | btnTemp.Text = (setTempAttr.min + ((double)e / 2)).ToString("0.0"); |
| | | double ex = (double)e / 2; |
| | | btnTemp.Text = (setTempAttr.min + ((double)ex)).ToString("0.0"); |
| | | d.Add(FunctionAttributeKey.SetTemp, (setTempAttr.min + ex).ToString()); |
| | | } |
| | | else |
| | | { |
| | | btnTemp.Text = (setTempAttr.min + e).ToString(); |
| | | d.Add(FunctionAttributeKey.SetTemp, (setTempAttr.min + e).ToString()); |
| | | } |
| | | |
| | | #if __IOS__ |
| | |
| | | #endif |
| | | btnTempUint.X = btnTemp.Right; |
| | | controlTime = DateTime.Now; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, (setTempAttr.min + e).ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | |
| | |
| | | |
| | | btnModeIcon.UnSelectedImagePath = acFunction.GetModeIconPath(m, false); |
| | | btnModeIcon.SelectedImagePath = acFunction.GetModeIconPath(m); |
| | | btnModeText.Text = acFunction.GetModeAttrText( m); |
| | | btnModeText.Text = acFunction.GetModeAttrText(m); |
| | | |
| | | if (modeList.IndexOf(m) < modeList.Count - 1) |
| | | { |
| | |
| | | d.Add(FunctionAttributeKey.Mode, m); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | dialog.Close(); |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan" || device.GetAttrState(FunctionAttributeKey.Mode) == "dry") |
| | | { |
| | | |
| | | setTempBar.IsClickable = false; |
| | |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | modeChangeView.AddChidren(btnFanText); |
| | | btnFanIcon.UnSelectedImagePath = acFunction.GetFanIconPath(m,false); |
| | | btnFanIcon.UnSelectedImagePath = acFunction.GetFanIconPath(m, false); |
| | | btnFanIcon.SelectedImagePath = acFunction.GetFanIconPath(m); |
| | | btnFanText.Text = acFunction.GetFanAttrText(m); |
| | | |
| | |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(296+200), |
| | | Width = Application.GetRealWidth(296 + 200), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | int index = 0; |
| | | List<FunctionAttributes> attrList = new List<FunctionAttributes>(); |
| | | attrList.AddRange(device.attributes); |
| | | attrList.Add(new FunctionAttributes() { |
| | | attrList.Add(new FunctionAttributes() |
| | | { |
| | | key = "+", |
| | | }); |
| | | |
| | |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | }; |
| | | if (attr.value.Count > 0) |
| | | { |
| | | btn.Text = attr.value[0]; |
| | | } |
| | | if (index % 3 == 1) |
| | | { |
| | | btn.Gravity = Gravity.Center; |
| | | } |
| | | else if (index % 3 == 2) |
| | | { |
| | | btn.X = Application.GetRealWidth(208); |
| | | } |
| | | row.AddChidren(btn); |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!device.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | //} |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | |
| | | new System.Threading.Thread(() => |
| | | if (attr.value.Count > 0) |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | btn.Text = attr.value[0]; |
| | | } |
| | | if (index % 3 == 1) |
| | | { |
| | | btn.Gravity = Gravity.Center; |
| | | } |
| | | else if (index % 3 == 2) |
| | | { |
| | | btn.X = Application.GetRealWidth(208); |
| | | } |
| | | row.AddChidren(btn); |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!device.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | //} |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | btn.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btn.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | //device = FunctionList.List.Functions.Find((obj) => obj.sid == device.sid); |
| | | |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.Indoor) + " " + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C"; |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.Indoor) + " " |
| | | + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) |
| | | + acFunction.GetTempUnitString(device); |
| | | btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing)); |
| | | btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode), false); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false); |
| | | |
| | | |
| | | if (device.GetAttribute(FunctionAttributeKey.SetTemp).step == "0.5") |
| | | { |
| | | var t = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | |
| | | #if __IOS__ |
| | | btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); |
| | | btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); |
| | | #endif |
| | | btnTempUint.X = btnTemp.Right; |
| | | |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true; |
| | | setTempBar.Enable = true; |
| | | //setTempBar.Enable = true; |
| | | setTempBar.ProgressBarColor = CSS_Color.MainColor; |
| | | |
| | | btnSwitch.IsSelected = true; |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | setTempBar.IsClickable = false; |
| | | } |
| | | else |
| | | { |
| | | setTempBar.IsClickable = true; |
| | | } |
| | | //if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | //{ |
| | | // setTempBar.IsClickable = false; |
| | | //} |
| | | //else |
| | | //{ |
| | | // setTempBar.IsClickable = true; |
| | | //} |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | setTempBar.IsClickable = false; |
| | | } |
| | | |
| | | if(device.GetAttrState(FunctionAttributeKey.Mode) == "dry") |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "dry" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | setTempBar.IsOffline = true; |
| | | setTempBar.IsClickable = false; |
| | | |
| | | }else |
| | | { |
| | | setTempBar.IsOffline = false; |
| | | setTempBar.IsClickable = true; |
| | | } |
| | | } |
| | | |