| | |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | BatteryPersentControl batteryControl; |
| | | /// <summary> |
| | | /// 初始化第一个索引页的内容 |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | //电池控件 |
| | | this.batteryControl = new BatteryPersentControl(); |
| | | //它有个最小的X轴 |
| | | batteryControl.X = Application.GetRealWidth(104) > base.btnRoomName.Right ? Application.GetRealWidth(104) : base.btnRoomName.Right + Application.GetRealWidth(4); |
| | | if (batteryControl.Height > base.btnRoomName.Height) |
| | | { |
| | | //一个是25,一个是21,弄不准到底谁更高,因为计算方法不一样 |
| | | batteryControl.Y = base.btnRoomName.Y - (batteryControl.Height - base.btnRoomName.Height) / 2; |
| | | } |
| | | else |
| | | { |
| | | batteryControl.Y = base.btnRoomName.Y + (batteryControl.Height - base.btnRoomName.Height) / 2; |
| | | } |
| | | batteryControl.InitControl(false); |
| | | batteryControl.SetValue(80); |
| | | var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | { |
| | | if (powerLowTipAttr.state.ToLower() == "low") |
| | | { |
| | | batteryControl.SetValue(20); |
| | | } |
| | | } |
| | | FrameWhiteCentet1.AddChidren(batteryControl); |
| | | |
| | | |
| | | btnIcon = new IconViewControl(198) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | else |
| | | { |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.TextID = StringId.wuren; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); |
| | | if (temp.state == "true") |
| | | { |
| | | btnIcon.IsSelected = true; |
| | | btnSuctionView.TextID = StringId.InAlarming; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.wuren; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | } |
| | | |
| | | var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | { |
| | | if (powerLowTipAttr.state.ToLower() == "low") |
| | | { |
| | | batteryControl.SetValue(20); |
| | | } |
| | | else |
| | | { |
| | | batteryControl.SetValue(80); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |