| | |
| | | /// </summary> |
| | | Button btnPowerControl; |
| | | |
| | | |
| | | |
| | | |
| | | public WaterHeaterJinmaoPage(Function deviceFunction) |
| | | { |
| | | bodyView = this; |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region flow 热水流量 |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | |
| | | { |
| | | Height = Application.GetRealWidth(8) |
| | | }); |
| | | |
| | | #region 社会贡献 Social contribution |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(46), |
| | | Width = Application.GetRealWidth(100), |
| | | X = Application.GetRealWidth(16), |
| | | Text = "社会贡献", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true |
| | | }); |
| | | |
| | | var socialContributionView = new HorizontalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(142), |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(socialContributionView); |
| | | |
| | | #region 热回收节电量 |
| | | var socialContribution_InfoView_1 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(109), |
| | | Height = Application.GetRealWidth(130), |
| | | BackgroundImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoBg_1.png" |
| | | }; |
| | | socialContributionView.AddChidren(socialContribution_InfoView_1); |
| | | |
| | | var socialContribution_Info1_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoIcon_1.png" |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_IconButton); |
| | | |
| | | socialContribution_Info1_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | }; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesButton); |
| | | |
| | | socialContribution_Info1_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info1_ValuesButton.Right , |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "kwh", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton); |
| | | |
| | | var socialContribution_Info1_TipButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(98), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "热回收节电量", |
| | | TextSize = 12, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_TipButton); |
| | | #endregion |
| | | |
| | | socialContributionView.AddChidren(new Button() |
| | | #region 社会贡献 Social contribution |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()) != null |
| | | && function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.co2.ToString()) != null |
| | | && function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.trees.ToString()) != null) |
| | | { |
| | | Width = Application.GetRealWidth(8), |
| | | }); |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(46), |
| | | Width = Application.GetRealWidth(100), |
| | | X = Application.GetRealWidth(16), |
| | | Text = "社会贡献", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true |
| | | }); |
| | | |
| | | #region CO2减排量 |
| | | var socialContribution_InfoView_2 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(109), |
| | | Height = Application.GetRealWidth(130), |
| | | BackgroundImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoBg_2.png" |
| | | }; |
| | | socialContributionView.AddChidren(socialContribution_InfoView_2); |
| | | var socialContributionView = new HorizontalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(142), |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(socialContributionView); |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()) != null) |
| | | { |
| | | #region 热回收节电量 |
| | | var socialContribution_InfoView_1 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(109), |
| | | Height = Application.GetRealWidth(130), |
| | | BackgroundImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoBg_1.png" |
| | | }; |
| | | socialContributionView.AddChidren(socialContribution_InfoView_1); |
| | | |
| | | var socialContribution_Info2_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoIcon_2.png" |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_IconButton); |
| | | var socialContribution_Info1_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoIcon_1.png" |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_IconButton); |
| | | |
| | | socialContribution_Info2_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | }; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesButton); |
| | | socialContribution_Info1_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | }; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesButton); |
| | | |
| | | socialContribution_Info1_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info1_ValuesButton.Right, |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "kwh", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton); |
| | | |
| | | var socialContribution_Info1_TipButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(98), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "热回收节电量", |
| | | TextSize = 12, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_TipButton); |
| | | #endregion |
| | | |
| | | socialContributionView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(8), |
| | | }); |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.co2.ToString()) != null) |
| | | { |
| | | #region CO2减排量 |
| | | var socialContribution_InfoView_2 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(109), |
| | | Height = Application.GetRealWidth(130), |
| | | BackgroundImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoBg_2.png" |
| | | }; |
| | | socialContributionView.AddChidren(socialContribution_InfoView_2); |
| | | |
| | | var socialContribution_Info2_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoIcon_2.png" |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_IconButton); |
| | | |
| | | socialContribution_Info2_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | }; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesButton); |
| | | |
| | | |
| | | socialContribution_Info2_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info2_ValuesButton.Right , |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "吨", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | socialContribution_Info2_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info2_ValuesButton.Right, |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "吨", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | |
| | | var socialContribution_Info2_TipButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(98), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "CO2减排量", |
| | | TextSize = 12, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_TipButton); |
| | | #endregion |
| | | var socialContribution_Info2_TipButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(98), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "CO2减排量", |
| | | TextSize = 12, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_TipButton); |
| | | #endregion |
| | | |
| | | socialContributionView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(8), |
| | | }); |
| | | socialContributionView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(8), |
| | | }); |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.trees.ToString()) != null) |
| | | { |
| | | #region 等效植树量 |
| | | var socialContribution_InfoView_3 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(109), |
| | | Height = Application.GetRealWidth(130), |
| | | BackgroundImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoBg_3.png" |
| | | }; |
| | | socialContributionView.AddChidren(socialContribution_InfoView_3); |
| | | |
| | | #region 等效植树量 |
| | | var socialContribution_InfoView_3 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(109), |
| | | Height = Application.GetRealWidth(130), |
| | | BackgroundImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoBg_3.png" |
| | | }; |
| | | socialContributionView.AddChidren(socialContribution_InfoView_3); |
| | | var socialContribution_Info3_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoIcon_3.png" |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_IconButton); |
| | | |
| | | var socialContribution_Info3_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/SocialContributionInfoIcon_3.png" |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_IconButton); |
| | | socialContribution_Info3_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | }; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesButton); |
| | | |
| | | socialContribution_Info3_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | }; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesButton); |
| | | |
| | | socialContribution_Info3_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info3_ValuesButton.Right , |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "棵", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | socialContribution_Info3_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info3_ValuesButton.Right, |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "棵", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(98), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "等效植树量", |
| | | TextSize = 12, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_TipButton); |
| | | #endregion |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(98), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "等效植树量", |
| | | TextSize = 12, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_TipButton); |
| | | #endregion |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | |
| | | Height = Application.GetRealWidth(50), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(16), |
| | | SelectedImagePath = "FunctionIcon/Acst/orange/PowerIcon.png", |
| | | UnSelectedImagePath = "FunctionIcon/Acst/grey/PowerOffIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Acst/blue/PowerIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | bottomView.AddChidren(btnPowerControl); |
| | |
| | | //节能模式控制 |
| | | btnControlModeEconomic.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new System.Threading.Thread(() => |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.economic.ToString()); |
| | | Control.Ins.SendWriteCommand(function, dic); |
| | | function.SetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.economic.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.economic.ToString()); |
| | | Control.Ins.SendWriteCommand(function, dic); |
| | | function.SetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.economic.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | updateModeUI(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | updateModeUI(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | //速热模式控制 |
| | | btnControlModeQuickHeat.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new System.Threading.Thread(() => |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.quick_heat.ToString()); |
| | | Control.Ins.SendWriteCommand(function, dic); |
| | | function.SetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.quick_heat.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.quick_heat.ToString()); |
| | | Control.Ins.SendWriteCommand(function, dic); |
| | | function.SetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString(), WaterHeaterJinmao_Attr_ModeEnum.quick_heat.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | updateModeUI(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | updateModeUI(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | setTemp_Bar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | |
| | | try |
| | | { |
| | | bodyView.updateFreeMode(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateTemp(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateModeUI(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateSetTemp(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateFlow(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateVolume(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateSocialContribution1(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateSocialContribution2(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateSocialContribution3(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updatePowerButton(); |
| | | }catch (Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | |
| | | /// </summary> |
| | | private void updateSocialContribution1() |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()); |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | if (socialContribution_Info1_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()) != null) |
| | | { |
| | | socialContribution_Info1_ValuesButton.TextSize = 14; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | try |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()); |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | if (socialContribution_Info1_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info1_ValuesButton.TextSize = 14; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | #if __IOS__ |
| | | 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); |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right + Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡2献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution2() |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | if (socialContribution_Info2_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.co2.ToString()) != null) |
| | | { |
| | | socialContribution_Info2_ValuesButton.TextSize = 14; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | } |
| | | try |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | if (socialContribution_Info2_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info2_ValuesButton.TextSize = 14; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | } |
| | | #if __IOS__ |
| | | 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); |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right + Application.GetRealWidth(2); |
| | | #endif |
| | | |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡3献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | if (socialContribution_Info3_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.trees.ToString()) != null) |
| | | { |
| | | socialContribution_Info3_ValuesButton.TextSize = 14; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | //socialContribution_Info3_UintButton.Height = Application.GetRealWidth(23); |
| | | } |
| | | try |
| | | { |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | if (socialContribution_Info3_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info3_ValuesButton.TextSize = 14; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | //socialContribution_Info3_UintButton.Height = Application.GetRealWidth(23); |
| | | } |
| | | #if __IOS__ |
| | | 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); |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right + Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |