| | |
| | | /// </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) |
| | | }); |
| | | #endregion |
| | | |
| | | #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) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(46), |
| | |
| | | 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(8), |
| | | }); |
| | | |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.co2.ToString()) != null) |
| | | { |
| | | #region CO2减排量 |
| | | var socialContribution_InfoView_2 = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | Width = Application.GetRealWidth(8), |
| | | }); |
| | | |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.trees.ToString()) != null) |
| | | { |
| | | #region 等效植树量 |
| | | var socialContribution_InfoView_3 = new FrameLayout() |
| | | { |
| | |
| | | }; |
| | | 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(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | }; |
| | | //速热模式控制 |
| | | btnControlModeQuickHeat.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | }); |
| | | }) |
| | | { 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() |
| | | { |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()) != null) |
| | | { |
| | | 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_UintButton.X = socialContribution_Info1_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡2献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution2() |
| | | { |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.co2.ToString()) != null) |
| | | { |
| | | try |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | |
| | | #else |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡3献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.trees.ToString()) != null) |
| | | { |
| | | try |
| | | { |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新开关按钮状态 |