using Shared.Phone.UserCenter;
using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
namespace Shared.Phone.MainPage.Controls
{
///
/// PM2.5卡片控件
///
public class DevicePmSensorCardControl : DeviceCardCommon
{
#region ■ 初始化_____________________________
///
/// 初始化控件
///
///
public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom)
{
base.InitControl(i_device, i_nowSelectRoom);
//添加跳转深度卡片信息事件
this.AddDetailInfoEvent(i_device);
}
#endregion
#region ■ 深度卡片信息_______________________
///
/// 添加跳转深度卡片信息事件
///
private void AddDetailInfoEvent(CommonDevice i_device)
{
//深度卡片信息
this.ButtonClickEvent += (sender, e) =>
{
Common.CommonPage.Instance.IsDrawerLockMode = true;
//PM2.5传感器类型的深度卡片界面
var form = new ControlForm.DevicePmSensorDetailCardForm();
form.RowOrCardControl = this;
form.AddForm(i_device, this.nowSelectRoom, 965, 1374);
form.FormCloseEvent += this.CardDetailInfoBackEvent;
};
}
#endregion
#region ■ 发送获取状态命令___________________
///
/// 发送获取状态命令
///
public override void SendStatuComand()
{
if (Common.Config.Instance.Home.IsVirtually == true)
{
//如果住宅为虚拟住宅,则此功能无效
return;
}
//检测能否发送获取状态命令
if (this.CheckCanSendStatuComand() == true)
{
HdlDeviceAttributeLogic.Current.SendPmSensorComand(this.device);
}
}
#endregion
}
}