| | |
| | | /// </summary> |
| | | Button btnTemp; |
| | | Button btnTempUint; |
| | | |
| | | /// <summary> |
| | | /// 室内湿度显示控件 |
| | | /// </summary> |
| | | TextButton btnHumidityValues; |
| | | /// <summary> |
| | | /// 室内温度显示控件 |
| | | /// </summary> |
| | | TextButton btnTempValues; |
| | | /// <summary> |
| | | /// 室内温度按钮 |
| | | /// </summary> |
| | | Button btnIndoorTemp; |
| | | //Button btnIndoorTemp; |
| | | /// <summary> |
| | | /// 模式按钮 |
| | | /// </summary> |
| | | Button btnMode; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | Button btnModeText; |
| | | /// <summary> |
| | | /// 风速按钮 |
| | | /// </summary> |
| | |
| | | this.RefreshNowDeviceStatuMemory(this.device); |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | controlTime = DateTime.Now; |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | { |
| | | if (controlTime == DateTime.MinValue) |
| | | { |
| | | |
| | | |
| | | } |
| | | else if (controlTime.AddSeconds(2) < DateTime.Now) |
| | | { |
| | |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | Button btnJinmaoIcon = new Button() |
| | | var btnHumidityIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(94), |
| | | Width = Application.GetRealWidth(164), |
| | | Height = Application.GetRealHeight(43), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/JinMaoIcon.png" |
| | | X = Application.GetRealWidth(194), |
| | | Y = Application.GetRealHeight(101), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacHumidityIcon.png", |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnJinmaoIcon); |
| | | FrameWhiteCentet1.AddChidren(btnHumidityIcon); |
| | | btnHumidityValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(222), |
| | | Y = Application.GetRealHeight(96), |
| | | Height = Application.GetRealHeight(33), |
| | | Width = Application.GetRealWidth(100), |
| | | TextColor = 0xFF161616, |
| | | TextSize = 24, |
| | | Text = device.GetAttrState(FunctionAttributeKey.RoomHumidity) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnHumidityValues); |
| | | |
| | | Button btnTempIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(55), |
| | | Y = Application.GetRealHeight(101), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacTempIcon.png", |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTempIcon); |
| | | |
| | | btnTempValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(83), |
| | | Y = Application.GetRealHeight(96), |
| | | Height = Application.GetRealHeight(33), |
| | | Width = Application.GetRealWidth(100), |
| | | TextColor = 0xFF161616, |
| | | TextSize = 24, |
| | | Text = device.GetAttrState(FunctionAttributeKey.RoomTemp) + "°C", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTempValues); |
| | | |
| | | |
| | | temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | if (temp <= 0) |
| | | { |
| | | //默认值改成16,2022年06月10日10:03:19 成甫要求的 |
| | | temp = 16; |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | } |
| | |
| | | OfflineProgressBarColor = CSS_Color.PromptingColor2, |
| | | ArcColor = CSS_Color.BackgroundColor, |
| | | #if __IOS__ |
| | | Y = Application.GetRealHeight(120 + 25), |
| | | Y = Application.GetRealHeight(130 + 25), |
| | | Width = Application.GetRealWidth(260 - 40), |
| | | Height = Application.GetRealWidth(260 - 40), |
| | | SeekBarPadding = Application.GetRealWidth(8), |
| | | #else |
| | | Y = Application.GetRealHeight(120 + 40), |
| | | Y = Application.GetRealHeight(130 + 40), |
| | | Width = Application.GetRealWidth(260 - 40), |
| | | Height = Application.GetRealWidth(260 - 40), |
| | | SeekBarPadding = Application.GetRealWidth(7), |
| | |
| | | btnTemp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(206), |
| | | Y = Application.GetRealHeight(226), |
| | | Width = Application.GetRealWidth(71), |
| | | Height = Application.GetRealWidth(60), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTempUint); |
| | | |
| | | btnIndoorTemp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnTemp.Bottom, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(20), |
| | | Text = Language.StringByID(StringId.IndoorTemp) + "20°C/" + Language.StringByID(StringId.Humidity) +"45%", |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnIndoorTemp); |
| | | //btnIndoorTemp = new Button() |
| | | //{ |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = btnTemp.Bottom, |
| | | // Width = Application.GetRealWidth(120), |
| | | // Height = Application.GetRealHeight(20), |
| | | // Text = Language.StringByID(StringId.IndoorTemp) + "20°C/" + Language.StringByID(StringId.Humidity) +"45%", |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | //}; |
| | | //FrameWhiteCentet1.AddChidren(btnIndoorTemp); |
| | | |
| | | btnMinus = new Button() |
| | | { |
| | |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnMode); |
| | | |
| | | Button btnModeText = new Button() |
| | | btnModeText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(30), |
| | | Y = btnMode.Bottom, |
| | | Y = btnMode.Bottom + Application.GetRealHeight(4), |
| | | Width = Application.GetRealWidth(90), |
| | | Height = Application.GetRealHeight(20), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextID = StringId.Mode |
| | | Text = acFunction.GetModeAttrText(device.GetAttrState(FunctionAttributeKey.Mode)) |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnModeText); |
| | | |
| | |
| | | /// </summary> |
| | | void LoadEvent_AcStatesChange() |
| | | { |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | | LoadDiv_ChangeModeView(); |
| | | var modeValueList = device.GetAttribute(FunctionAttributeKey.Mode).value; |
| | | if (modeValueList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var curMode = device.GetAttrState(FunctionAttributeKey.Mode); |
| | | var curModeIndex = device.GetAttribute(FunctionAttributeKey.Mode).value.IndexOf(curMode); |
| | | if (++curModeIndex >= modeValueList.Count) |
| | | { |
| | | curModeIndex = 0; |
| | | } |
| | | var setMode = device.GetAttribute(FunctionAttributeKey.Mode).value[curModeIndex]; |
| | | |
| | | device.SetAttrState(FunctionAttributeKey.Mode, setMode); |
| | | btnModeText.Text = acFunction.GetModeAttrText(setMode); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(setMode); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Mode, setMode); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | |
| | | //LoadDiv_ChangeModeView(); |
| | | }; |
| | | |
| | | btnMode.MouseUpEventHandler = eventHandler; |
| | | btnModeText.MouseUpEventHandler = eventHandler; |
| | | |
| | | |
| | | |
| | | btnWindSpeed.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new CacHistoryChoosePage(device); |
| | |
| | | } |
| | | else |
| | | { |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C" |
| | | + Language.StringByID(StringId.Humidity) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState("room_humidity").Replace(", ", "."))) + "%"; |
| | | //btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C" |
| | | // + Language.StringByID(StringId.Humidity) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState("room_humidity").Replace(", ", "."))) + "%"; |
| | | btnTempValues.Text = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", ".")) + "°C"; |
| | | btnHumidityValues.Text = Convert.ToDouble(device.GetAttrState("room_humidity").Replace(", ", ".")) + "%"; |
| | | |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | btnModeText.Text = acFunction.GetModeAttrText(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | |
| | | temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); |
| | | |
| | | |