| | |
| | | initContentView(); |
| | | initBottomView(); |
| | | initControlEvent(); |
| | | Control.Ins.SendReadCommand(function); |
| | | |
| | | UpdateStatus(); |
| | | |
| | | Control.Ins.SendReadCommand(function); |
| | | } |
| | | /// <summary> |
| | | /// 加载内容区域 |
| | |
| | | setTempView.AddChidren(setTemp_Temp_MaxValuesTextButton); |
| | | #endregion |
| | | |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(12), |
| | |
| | | flowView.AddChidren(flow_ElectricDriveValuesButton); |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | |
| | | var socialContribution_Info2_TipButton = new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | |
| | | setTemp_ValuesButton.Width = setTemp_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | setTemp_ValuesButton.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | #if __IOS__ |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right + Application.GetRealWidth(4); |
| | | #endif |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | |
| | | //免费热水 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | bodyView.updateFreeMode(); |
| | | bodyView.updateTemp(); |
| | | bodyView.updateModeUI(); |
| | |
| | | bodyView.updateSocialContribution2(); |
| | | bodyView.updateSocialContribution3(); |
| | | bodyView.updatePowerButton(); |
| | | }catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | btnTempValues.TextSize = 28; |
| | | } |
| | | btnTempValues.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | #if __IOS__ |
| | | btnTempValuesUint.X = btnTempValues.Right - Application.GetRealWidth(4); |
| | | #else |
| | | btnTempValuesUint.X = btnTempValues.Right ; |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | #endif |
| | | setTemp_ValuesButton.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | #if __IOS__ |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right + Application.GetRealWidth(4); |
| | | |
| | | #endif |
| | | |
| | | double dd = 35; |
| | | double.TryParse(function.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString(), "0"), out dd); |
| | |
| | | /// </summary> |
| | | private void updateFlow() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | | { |
| | | flow_ValuesButton.Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateVolume() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.volume.ToString()) == null) |
| | | { |
| | | return; |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()) == null) |
| | | { |
| | | return; |
| | | } |
| | | volumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()); |
| | | recyclVolumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()); |
| | | volume = 0; |
| | |
| | | private void updateSocialContribution1() |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info1_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info1_ValuesButton.TextSize = 14; |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right ; |
| | | socialContribution_Info1_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | |
| | | private void updateSocialContribution2() |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info2_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info2_ValuesButton.TextSize = 14; |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | socialContribution_Info2_UintButton.Y = socialContribution_Info2_UintButton.Y - Application.GetRealWidth(4); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right; |
| | | socialContribution_Info2_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info3_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info3_ValuesButton.TextSize = 14; |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | //socialContribution_Info3_UintButton.Height = Application.GetRealWidth(23); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right; |
| | | socialContribution_Info3_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |