| | |
| | | Button flow_ElectricDriveValuesButton; |
| | | string volumeString = string.Empty; |
| | | string recyclVolumeString = string.Empty; |
| | | double volume = 0; |
| | | double recyclVolume = 0; |
| | | double volume = 0.00; |
| | | double recyclVolume = 0.00; |
| | | int recyclVolumePercent = 0; |
| | | |
| | | /// <summary> |
| | |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnPowerControl; |
| | | |
| | | |
| | | |
| | | |
| | | public WaterHeaterJinmaoPage(Function deviceFunction) |
| | | { |
| | |
| | | initContentView(); |
| | | initBottomView(); |
| | | initControlEvent(); |
| | | |
| | | UpdateStatus(); |
| | | |
| | | Control.Ins.SendReadCommand(function); |
| | | } |
| | | /// <summary> |
| | |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(16) }); |
| | | |
| | | #region 热水器状态 |
| | | var infoView = new FrameLayout() |
| | | FrameLayout infoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | { |
| | | X = 0 - Application.GetRealWidth(14), |
| | | Y = Application.GetRealWidth(12), |
| | | Width = Application.GetRealWidth(68 + 14), |
| | | Width = Application.GetRealWidth(82 + 14), |
| | | Height = Application.GetRealWidth(28), |
| | | BackgroundColor = 0x15FC9C04, |
| | | Radius = (uint)Application.GetRealWidth(14), |
| | |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString(), "---"), |
| | | }; |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(8); |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(6); |
| | | if (btnTempValues.Width > Application.GetRealWidth(80)) |
| | | { |
| | | btnTempValues.TextSize = 28; |
| | | } |
| | | btnTempValues.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | infoView_Temp_View.AddChidren(btnTempValues); |
| | | |
| | | btnTempValuesUint = new Button() |
| | | { |
| | | X = btnTempValues.Right - Application.GetRealWidth(4), |
| | | X = btnTempValues.Right, |
| | | Y = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(66), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 设置温度 |
| | | #region 温度设置 |
| | | var setTempView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | SeekBarViewHeight = Application.GetRealHeight(14), |
| | | ThumbImagePath = "FunctionIcon/Acst/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(51), |
| | | ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? 0xFFFFB848 : CSS_Color.DividingLineColor, |
| | | MaxValue = 25, |
| | | Progress = setTempValue - 35, |
| | | ProgressBarColor = 0xFFFFB848 , |
| | | MaxValue = 60, |
| | | MinValue = 35, |
| | | Progress = setTempValue, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | IsProgressTextShow = false, |
| | | ProgressChangeDelayTime = 0, |
| | | }; |
| | | setTemp_Bar.ProgressChangeDelayTime = 0; |
| | | setTempView.AddChidren(setTemp_Bar); |
| | | |
| | | var setTemp_Temp_MinValuesTextButton = new Button() |
| | |
| | | setTempView.AddChidren(setTemp_Temp_MaxValuesTextButton); |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(12), |
| | | }); |
| | | |
| | | #region flow 热水流量 |
| | | var flowView = new FrameLayout() |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(186), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(flowView); |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(12), |
| | | }); |
| | | |
| | | flow_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(14), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min", |
| | | IsBold = true, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesButton); |
| | | #region flow 热水流量 |
| | | var flowView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(186), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(flowView); |
| | | |
| | | var flow_HotWaterVolumeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | Text = "热水量", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_HotWaterVolumeTextButton); |
| | | flow_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(14), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min", |
| | | IsBold = true, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesButton); |
| | | |
| | | string volumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()); |
| | | string recyclVolumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()); |
| | | double volume = 0; |
| | | double.TryParse(volumeString, out volume); |
| | | double recyclVolume = 0; |
| | | double.TryParse(recyclVolumeString, out recyclVolume); |
| | | int recyclVolumePercent = (int)(recyclVolume / volume * 100); |
| | | var flow_HotWaterVolumeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | Text = "热水量", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_HotWaterVolumeTextButton); |
| | | |
| | | string volumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()); |
| | | string recyclVolumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()); |
| | | double volume = 0; |
| | | double.TryParse(volumeString, out volume); |
| | | double recyclVolume = 0; |
| | | double.TryParse(recyclVolumeString, out recyclVolume); |
| | | int recyclVolumePercent = (int)(recyclVolume / volume * 100); |
| | | |
| | | |
| | | flow_VolumeButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(26), |
| | | Text = volumeString + "t", |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_VolumeButton); |
| | | flow_VolumeButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(26), |
| | | Text = volumeString + "t", |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_VolumeButton); |
| | | |
| | | |
| | | flow_ValuesBar = new DiyImageSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(79), |
| | | Width = Application.GetRealWidth(Application.DesignWidth - 64), |
| | | Height = Application.GetRealHeight(8), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImageHeight = Application.GetRealHeight(0), |
| | | ProgressBarColor = 0xFF42D163, |
| | | SeekBarBackgroundColor = 0xFFFFB848, |
| | | MaxValue = 100, |
| | | Progress = recyclVolumePercent, |
| | | SeekBarPadding = Application.GetRealWidth(0), |
| | | IsProgressTextShow = false, |
| | | ProgressChangeDelayTime = 0, |
| | | Enable = false, |
| | | IsClickable = false, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesBar); |
| | | flow_ValuesBar = new DiyImageSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(79), |
| | | Width = Application.GetRealWidth(Application.DesignWidth - 64), |
| | | Height = Application.GetRealHeight(8), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImageHeight = Application.GetRealHeight(0), |
| | | ProgressBarColor = 0xFF42D163, |
| | | SeekBarBackgroundColor = 0xFFFFB848, |
| | | MaxValue = 100, |
| | | Progress = recyclVolumePercent, |
| | | SeekBarPadding = Application.GetRealWidth(0), |
| | | IsProgressTextShow = false, |
| | | ProgressChangeDelayTime = 0, |
| | | Enable = false, |
| | | IsClickable = false, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesBar); |
| | | |
| | | var flow_HeatRecoveryCapacitytTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = "热回收量" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryCapacitytTextButton); |
| | | var flow_HeatRecoveryCapacitytTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = "热回收量" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryCapacitytTextButton); |
| | | |
| | | flow_HeatRecoveryProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = recyclVolumePercent + "%" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryProgressButton); |
| | | flow_HeatRecoveryProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = recyclVolumePercent + "%" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryProgressButton); |
| | | |
| | | flow_HeatRecoverytValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = recyclVolume + "t" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoverytValuesButton); |
| | | flow_HeatRecoverytValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = recyclVolume + "t" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoverytValuesButton); |
| | | |
| | | var flow_ElectricDriveTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "电直驱量", |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveTextButton); |
| | | |
| | | flow_ElectricDriveProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "0%" |
| | | }; |
| | | if (volume > 0) |
| | | { |
| | | flow_ElectricDriveProgressButton.Text = (100 - recyclVolumePercent) + "%"; |
| | | } |
| | | flowView.AddChidren(flow_ElectricDriveProgressButton); |
| | | |
| | | var flow_ElectricDriveTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "电直驱量" |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveTextButton); |
| | | flow_ElectricDriveValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = (volume - recyclVolume) + "t" |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveValuesButton); |
| | | |
| | | flow_ElectricDriveProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = (100 - recyclVolumePercent) + "%" |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveProgressButton); |
| | | |
| | | flow_ElectricDriveValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = (volume - recyclVolume) + "t" |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveValuesButton); |
| | | |
| | | #endregion |
| | | #endregion |
| | | } |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(8) |
| | | }); |
| | | #endregion |
| | | |
| | | #region 社会贡献 Social contribution |
| | | contentView.AddChidren(new Button() |
| | | 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) |
| | | { |
| | | Height = Application.GetRealWidth(46), |
| | | Width = Application.GetRealWidth(100), |
| | | X = Application.GetRealWidth(16), |
| | | Text = "社会贡献", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true |
| | | }); |
| | | 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); |
| | | 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); |
| | | |
| | | #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); |
| | | |
| | | 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_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); |
| | | |
| | | socialContribution_Info1_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4), |
| | | 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 |
| | | |
| | | 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); |
| | | |
| | | socialContributionView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(8), |
| | | }); |
| | | 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); |
| | | |
| | | #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_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 - Application.GetRealWidth(4), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "吨", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | 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); |
| | | |
| | | 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, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | socialContribution_Info3_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4), |
| | | Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | Text = "棵", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | 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) => |
| | | { |
| | | if (function.GetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString()) != WaterHeaterJinmao_Attr_ModeEnum.economic.ToString()) |
| | | 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) => |
| | | { |
| | | if (function.GetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString()) != WaterHeaterJinmao_Attr_ModeEnum.quick_heat.ToString()) |
| | | 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) => |
| | | { |
| | | contentView.ScrollEnabled = false; |
| | | }; |
| | | //设置温度调节 |
| | | setTemp_Bar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | contentView.ScrollEnabled = true; |
| | | #if __IOS__ |
| | | setTemp_ValuesButton.Width = setTemp_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | 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>(); |
| | |
| | | /// 更新界面状态 |
| | | /// </summary> |
| | | /// <param name="temp"></param> |
| | | public static void UpdateStatus(Function temp) |
| | | public static void UpdateStatus() |
| | | { |
| | | if (bodyView == null) |
| | | { |
| | | return; |
| | | } |
| | | //免费热水 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.mode_free.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.mode_free.ToString())) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | bodyView.function.SetAttrState(WaterHeaterJinmao_AttrEnum.mode_free.ToString(), temp.GetAttrState(WaterHeaterJinmao_AttrEnum.mode_free.ToString())); |
| | | Application.RunOnMainThread(() => |
| | | try |
| | | { |
| | | bodyView.updateFreeMode(); |
| | | }); |
| | | } |
| | | //热水温度 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString())) |
| | | { |
| | | bodyView.function.SetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString(), temp.GetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString())); |
| | | Application.RunOnMainThread(() => |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateTemp(); |
| | | }); |
| | | } |
| | | //热水器模式 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString())) |
| | | { |
| | | bodyView.function.SetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString(), temp.GetAttrState(WaterHeaterJinmao_AttrEnum.mode.ToString())); |
| | | Application.RunOnMainThread(() => |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateModeUI(); |
| | | }); |
| | | } |
| | | //热水器设置温度 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString())) |
| | | { |
| | | bodyView.function.SetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString(), temp.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString())); |
| | | Application.RunOnMainThread(() => |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateSetTemp(); |
| | | }); |
| | | } |
| | | //热水流量 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString())) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateFlow(); |
| | | }); |
| | | } |
| | | //热水总量 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()) || |
| | | bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString())) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | try |
| | | { |
| | | bodyView.updateVolume(); |
| | | }); |
| | | } |
| | | //社会贡献-节电量 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString())) |
| | | { |
| | | bodyView.updateSocialContribution1(); |
| | | } |
| | | //社会贡献-co2 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString())) |
| | | { |
| | | bodyView.updateSocialContribution2(); |
| | | } |
| | | //社会贡献-植树 |
| | | if (bodyView.function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()) != temp.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString())) |
| | | { |
| | | bodyView.updateSocialContribution3(); |
| | | } |
| | | //开关按钮 |
| | | if (bodyView.function.GetAttrState(FunctionAttributeKey.OnOff.ToString()) != temp.GetAttrState(FunctionAttributeKey.OnOff.ToString())) |
| | | { |
| | | bodyView.updatePowerButton(); |
| | | } |
| | | |
| | | } |
| | | 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) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateFreeMode() |
| | | { |
| | | if (function.GetAttrState(WaterHeaterJinmao_AttrEnum.mode_free.ToString()) != "true") |
| | | if (function.GetAttrState(WaterHeaterJinmao_AttrEnum.mode_free.ToString()) == "true") |
| | | { |
| | | modeFreeView.BackgroundColor = 0x1500C22D; |
| | | modeFreeView.Width = Width = Application.GetRealWidth(82 + 14); |
| | | modeFree_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/ModeFree_True.png"; |
| | | modeFree_TextButton.Text = "热回收"; |
| | | modeFree_TextButton.TextColor = 0xFF00C22D; |
| | |
| | | else |
| | | { |
| | | modeFreeView.BackgroundColor = 0x15FC9C04; |
| | | modeFreeView.Width = Width = Application.GetRealWidth(68 + 14); |
| | | modeFree_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/ModeFree_False.png"; |
| | | modeFree_TextButton.Text = "用电"; |
| | | modeFree_TextButton.TextColor = 0xFFFC9C04; |
| | |
| | | { |
| | | btnTempValues.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString(), "---"); |
| | | #if __IOS__ |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(8); |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(6); |
| | | #else |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | #endif |
| | | if (btnTempValues.Width > Application.GetRealWidth(80)) |
| | | { |
| | | 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 = 0; |
| | | double dd = 35; |
| | | double.TryParse(function.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString(), "0"), out dd); |
| | | setTemp_Bar.Progress = Convert.ToInt32(dd) - 35; |
| | | setTemp_Bar.Progress = Convert.ToInt32(dd); |
| | | |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | private void updateFlow() |
| | | { |
| | | flow_ValuesButton.Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min"; |
| | | 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; |
| | |
| | | flow_ValuesBar.Progress = recyclVolumePercent; |
| | | flow_HeatRecoveryProgressButton.Text = recyclVolumePercent + "%"; |
| | | flow_HeatRecoverytValuesButton.Text = recyclVolume + "t"; |
| | | flow_ElectricDriveProgressButton.Text = (100 - recyclVolumePercent) + "%"; |
| | | flow_ElectricDriveValuesButton.Text = (volume - recyclVolume) + "t"; |
| | | if (volume > 0) |
| | | { |
| | | flow_ElectricDriveProgressButton.Text = ((int)(100 - recyclVolumePercent)) + "%"; |
| | | } |
| | | flow_ElectricDriveValuesButton.Text = (((int)(volume * 100) - (int)(recyclVolume * 100)) / 100.0) + "t"; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateSocialContribution1() |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()); |
| | | |
| | | 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_ValuesButton.TextSize = 14; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | #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_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 |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡2献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution2() |
| | | { |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4); |
| | | |
| | | 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(); |
| | | 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); |
| | | #endif |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡3献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | 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(); |
| | | 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 = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | 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 |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | btnPowerControl.IsSelected = function.GetAttrState(FunctionAttributeKey.OnOff.ToString()) == "on"; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |