| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (basePage.sensorDiyView_Temp != null) |
| | | basePage.sensorDiyView_Temp.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.room_temp.ToString()).state); |
| | | basePage.sensorDiyView_Temp.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.room_temp.ToString()).state,true); |
| | | if (basePage.sensorDiyView_Humi != null) |
| | | basePage.sensorDiyView_Humi.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.room_humidity.ToString()).state); |
| | | basePage.sensorDiyView_Humi.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.room_humidity.ToString()).state, true); |
| | | if (basePage.sensorDiyView_Pm25 != null) |
| | | basePage.sensorDiyView_Pm25.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.pm25.ToString()).state); |
| | | basePage.sensorDiyView_Pm25.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.pm25.ToString()).state,false); |
| | | if (basePage.sensorDiyView_Co2 != null) |
| | | basePage.sensorDiyView_Co2.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.co2.ToString()).state); |
| | | basePage.sensorDiyView_Co2.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.co2.ToString()).state, false); |
| | | if (basePage.sensorDiyView_Tvoc != null) |
| | | basePage.sensorDiyView_Tvoc.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.tvoc.ToString()).state); |
| | | basePage.sensorDiyView_Tvoc.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.tvoc.ToString()).state, false); |
| | | if (basePage.sensorDiyView_EleDay != null) |
| | | basePage.sensorDiyView_EleDay.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.day_electricity.ToString()).state); |
| | | basePage.sensorDiyView_EleDay.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.day_electricity.ToString()).state, false); |
| | | if (basePage.sensorDiyView_EleMonth != null) |
| | | basePage.sensorDiyView_EleMonth.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.month_electricity.ToString()).state); |
| | | basePage.sensorDiyView_EleMonth.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.month_electricity.ToString()).state, false); |
| | | if (basePage.sensorDiyView_EleActivePower != null) |
| | | basePage.sensorDiyView_EleActivePower.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.active_power.ToString()).state); |
| | | basePage.sensorDiyView_EleActivePower.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.active_power.ToString()).state, false); |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | Width = Application.GetRealWidth(100 * energyCount), |
| | | Gravity = Gravity.Center, |
| | | Visible = false, |
| | | Visible = sensorCount == 0 |
| | | }; |
| | | if (energyCount > 0) |
| | | { |
| | |
| | | { |
| | | text = "Power"; |
| | | } |
| | | |
| | | sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "KW", text, 100); |
| | | } |
| | | if (dayObj != null) |
| | |
| | | { |
| | | text = "Power of today"; |
| | | } |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "KW", text, 100); |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "KWh", text, 100); |
| | | } |
| | | if (monthObj != null) |
| | | { |
| | |
| | | bottomView.AddChidren(btnModeControl); |
| | | btnModeControl.MouseUpEventHandler = (sender3, e3) => |
| | | { |
| | | if(function.trait_on_off.state == "off") |
| | | { |
| | | return; |
| | | } |
| | | //if(function.trait_on_off.state == "off") |
| | | //{ |
| | | // return; |
| | | //} |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var dialogView = new FrameLayout(); |
| | |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(100), |
| | | TextID = StringId.SelectScene, |
| | | TextID = StringId.SelectMode, |
| | | TextSize = 16, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | |
| | | heatView.AddChidren(heatIconButton); |
| | | #endregion |
| | | } |
| | | if (function.GetAttribute(AcstParent_AttrEnum.mode.ToString()).value.Contains(AcstParent_Attr_ModeValueEnum.humidity.ToString())) |
| | | { |
| | | |
| | | #region 除湿 |
| | | var dehumiView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(2), |
| | | Width = Application.GetRealWidth(144), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | dialogContentView.AddChidren(dehumiView); |
| | | dehumiView.AddChidren(new Button |
| | | { |
| | | Width = Application.GetRealWidth(112), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = 1, |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }); |
| | | IconButton dehumiIconButton = new IconButton("FunctionIcon/Acst/grey/ModeDeHumiIcon.png", $"FunctionIcon/Acst/{imageFolder}/ModeDeHumiIcon.png", |
| | | Language.StringByID(StringId.Humidity), curColor, function.GetAttrState(AcstParent_AttrEnum.mode.ToString()) == AcstParent_Attr_ModeValueEnum.dry.ToString()); |
| | | dehumiIconButton.Click(() => |
| | | { |
| | | btnModeControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/ModeDeHumiIcon2.png"; |
| | | dialog.Close(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("mode", AcstParent_Attr_ModeValueEnum.dry.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }); |
| | | dehumiView.AddChidren(dehumiIconButton); |
| | | #endregion |
| | | } |
| | | |
| | | if (function.GetAttribute(AcstParent_AttrEnum.mode.ToString()).value.Contains(AcstParent_Attr_ModeValueEnum.fan.ToString())) |
| | | { |
| | |
| | | #endregion |
| | | } |
| | | |
| | | if (function.GetAttribute(AcstParent_AttrEnum.mode.ToString()).value.Contains(AcstParent_Attr_ModeValueEnum.dry.ToString())) |
| | | { |
| | | #region 除湿 |
| | | var dehumiView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(2), |
| | | Width = Application.GetRealWidth(144), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | dialogContentView.AddChidren(dehumiView); |
| | | dehumiView.AddChidren(new Button |
| | | { |
| | | Width = Application.GetRealWidth(112), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = 1, |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }); |
| | | IconButton dehumiIconButton = new IconButton("FunctionIcon/Acst/grey/ModeDeHumiIcon.png", $"FunctionIcon/Acst/{imageFolder}/ModeDeHumiIcon.png", |
| | | Language.StringByID(StringId.Dry), curColor, function.GetAttrState(AcstParent_AttrEnum.mode.ToString()) == AcstParent_Attr_ModeValueEnum.dry.ToString()); |
| | | dehumiIconButton.Click(() => |
| | | { |
| | | btnModeControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/ModeDeHumiIcon2.png"; |
| | | dialog.Close(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("mode", AcstParent_Attr_ModeValueEnum.dry.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }); |
| | | dehumiView.AddChidren(dehumiIconButton); |
| | | #endregion |
| | | } |
| | | if (function.GetAttribute(AcstParent_AttrEnum.mode.ToString()).value.Contains(AcstParent_Attr_ModeValueEnum.heat_humidity.ToString())) |
| | | { |
| | | |
| | |
| | | |
| | | if (function.GetAttribute(AcstParent_AttrEnum.mode.ToString()).value.Contains(AcstParent_Attr_ModeValueEnum.humidity.ToString())) |
| | | { |
| | | |
| | | #region 加湿 |
| | | var humiView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | btnWorkSceneControl.MouseUpEventHandler = (sender2, e2) => |
| | | { |
| | | if (function.trait_on_off.state == "off") |
| | | { |
| | | return; |
| | | } |
| | | //if (function.trait_on_off.state == "off") |
| | | //{ |
| | | // return; |
| | | //} |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var dialogView = new FrameLayout(); |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = color, |
| | | TextSize = 20, |
| | | Text = value + unitString, |
| | | Text = value, |
| | | }; |
| | | contentView.AddChidren(btnValue); |
| | | |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = 0xFF949AA5, |
| | | TextSize = 12, |
| | | Text = text, |
| | | Text = text + "(" + unitString+")", |
| | | }; |
| | | contentView.AddChidren(btnText); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public void UpdateValue(string value) |
| | | public void UpdateValue(string value,bool isInt) |
| | | { |
| | | if (value.Contains(".") && isInt) |
| | | { |
| | | value = value.Remove(value.IndexOf('.'), value.Length - value.IndexOf('.')); |
| | | } |
| | | btnValue.Text = value + unitString; |
| | | } |
| | | } |