| | |
| | | public EnergyMainPage() |
| | | { |
| | | bodyView = this; |
| | | energyList = FunctionList.List.GetEnergyList(); |
| | | energyList = FunctionList.List.GetEnergyList(); |
| | | var breaker = FunctionList.List.Functions.FindAll((obj) => obj.spk == SPK.AirSwitch); |
| | | var energyBreker = breaker.FindAll((obj) => obj.GetAttribute("power") != null); |
| | | energyList.AddRange(energyBreker); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | double tt = 0; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt); |
| | | tt *= 100;//乘以100,小于1无法加载echart |
| | | tt = Math.Round(tt, 2); |
| | | list.Add(ene.name, tt.ToString()); |
| | | } |
| | | myEchartsView_Pie.ShowWithOption(new EchartsOption_Pie().InitDateJson(list)); |
| | |
| | | TextColor = CSS_Color.PromptingColor2, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = DateTime.Now.Month.ToString() + Language.StringByID(StringId.month), |
| | | Text = Language.StringByID(StringId.month),//DateTime.Now.Month.ToString() + |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Month); |
| | | |
| | |
| | | |
| | | row.Y = btnLine.Bottom; |
| | | view.AddChidren(row); |
| | | //记录需要更新的更新按钮 |
| | | listButton_value.Add(row.btnValue); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 记录需要更新的更新按钮 |
| | | /// </summary> |
| | | public List<Button> listButton_value = new List<Button>(); |
| | | |
| | | /// <summary> |
| | |
| | | var newValue = updataTemp.GetAttrState(FunctionAttributeKey.Power); |
| | | //if (newValue != btn.Text) |
| | | { |
| | | btn.Text = newValue; |
| | | btn.Text = Math.Round(double.Parse(newValue), 2).ToString();// +"W"; |
| | | UpdataValue(); |
| | | } |
| | | } |
| | |
| | | Dictionary<string, string> list = new Dictionary<string, string>();//饼图数据 |
| | | foreach (var ene in bodyView.energyList) |
| | | { |
| | | double power = 0; |
| | | double power = 0.00; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out power); |
| | | power = Math.Round(power, 2); |
| | | totalValue += power; |
| | | |
| | | int realTimePower = 0; |
| | | int.TryParse(ene.GetAttrState(FunctionAttributeKey.Power), out realTimePower); |
| | | double realTimePower = 0; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.Power), out realTimePower); |
| | | realtimeValue += realTimePower; |
| | | realtimeValue = Math.Round(realtimeValue, 2); |
| | | |
| | | #region 饼图数据 |
| | | double tt = 0; |
| | | double tt = 0.00; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt); |
| | | tt = Math.Round(tt, 2); |
| | | tt *= 100;//乘以100,小于1无法加载echart |
| | | list.Add(ene.name, tt.ToString()); |
| | | #endregion |