| | |
| | | SensorDiyView sensorDiyView_Tvoc; |
| | | SensorDiyView sensorDiyView_EleDay; |
| | | SensorDiyView sensorDiyView_EleMonth; |
| | | SensorDiyView sensorDiyView_EleTotal; |
| | | SensorDiyView sensorDiyView_EleActivePower; |
| | | #endregion |
| | | /// <summary> |
| | | /// 子控区域列表 |
| | |
| | | basePage.sensorDiyView_EleDay.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.day_electricity.ToString()).state); |
| | | if (basePage.sensorDiyView_EleMonth != null) |
| | | basePage.sensorDiyView_EleMonth.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.month_electricity.ToString()).state); |
| | | if (basePage.sensorDiyView_EleTotal != null) |
| | | basePage.sensorDiyView_EleTotal.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.total_electricity.ToString()).state); |
| | | if (basePage.sensorDiyView_EleActivePower != null) |
| | | basePage.sensorDiyView_EleActivePower.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.active_power.ToString()).state); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | if (tempObj != null) |
| | | { |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempObj.state == "" ? "--" : tempObj.state + "°", "温度"); |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempObj.state == "" ? "--" : tempObj.state, "°", "温度"); |
| | | } |
| | | if (humiObj != null) |
| | | { |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiObj.state == "" ? "--" : humiObj.state + "%", "湿度"); |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiObj.state == "" ? "--" : humiObj.state, "%", "湿度"); |
| | | } |
| | | if (pm25Obj != null) |
| | | { |
| | | sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "PM2.5"); |
| | | sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "PM2.5"); |
| | | } |
| | | if (co2Obj != null) |
| | | { |
| | | sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "CO2"); |
| | | sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "CO2"); |
| | | } |
| | | if (tvocObj != null) |
| | | { |
| | | sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "TVOC"); |
| | | sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "TVOC"); |
| | | } |
| | | #endregion |
| | | |
| | | #region 能耗数据 |
| | | int energyCount = 0; |
| | | var totalObj = function.GetAttribute(AcstParent_AttrEnum.active_power.ToString()); |
| | | if (totalObj != null) |
| | | { |
| | | energyCount++; |
| | | } |
| | | var dayObj = function.GetAttribute(AcstParent_AttrEnum.day_electricity.ToString()); |
| | | if (dayObj != null) |
| | | { |
| | |
| | | } |
| | | var monthObj = function.GetAttribute(AcstParent_AttrEnum.month_electricity.ToString()); |
| | | if (monthObj != null) |
| | | { |
| | | energyCount++; |
| | | } |
| | | var totalObj = function.GetAttribute(AcstParent_AttrEnum.total_electricity.ToString()); |
| | | if (totalObj != null) |
| | | { |
| | | energyCount++; |
| | | } |
| | |
| | | Visible = false, |
| | | }; |
| | | infoContentView.AddChidren(energyListView); |
| | | if (totalObj != null) |
| | | { |
| | | sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state , "KW", "用电功率", 100); |
| | | } |
| | | if (dayObj != null) |
| | | { |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state + "KW", "今日耗电",100); |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state , "KW", "今日耗电",100); |
| | | } |
| | | if (monthObj != null) |
| | | { |
| | | sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state + "KWh", "本月耗电", 100); |
| | | } |
| | | if (totalObj != null) |
| | | { |
| | | sensorDiyView_EleTotal = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state + "KWh", "总耗电量", 100); |
| | | sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state , "KWh", "本月耗电", 100); |
| | | } |
| | | |
| | | var btnChangeClick = new Button(); |
| | |
| | | private Button btnValue; |
| | | private Button btnText; |
| | | public string Tag; |
| | | public string unitString; |
| | | |
| | | public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string text,int setWidth = 60) |
| | | public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr,string text,int setWidth = 60) |
| | | { |
| | | unitString = unitStr; |
| | | if (string.IsNullOrEmpty(value)) |
| | | { |
| | | value = "--"; |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = color, |
| | | TextSize = 20, |
| | | Text = value, |
| | | Text = value + unitString, |
| | | }; |
| | | contentView.AddChidren(btnValue); |
| | | |
| | |
| | | |
| | | public void UpdateValue(string value) |
| | | { |
| | | btnText.Text = value; |
| | | btnValue.Text = value + unitString; |
| | | } |
| | | } |
| | | |
| | |
| | | btnRoomInfo.MouseUpEventHandler = eventHandler; |
| | | btnSubHumidityIcon.MouseUpEventHandler = eventHandler; |
| | | btnSubHumidityValues.MouseUpEventHandler = eventHandler; |
| | | btnSubPower.MouseUpEventHandler = eventHandler; |
| | | btnSubTempIcon.MouseUpEventHandler = eventHandler; |
| | | btnSubTempValues.MouseUpEventHandler = eventHandler; |
| | | subFunctionView.MouseUpEventHandler = eventHandler; |