using Shared.Phone.UserCenter;
|
using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using ZigBee.Device;
|
|
namespace Shared.Phone.MainPage.Controls
|
{
|
/// <summary>
|
/// 晾衣架卡片控件
|
/// </summary>
|
public class DeviceAirerCardControl : DeviceCardCommon
|
{
|
#region ■ 初始化_____________________________
|
|
/// <summary>
|
/// 初始化控件
|
/// </summary>
|
/// <param name="i_device"></param>
|
public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom)
|
{
|
base.InitControl(i_device, i_nowSelectRoom);
|
|
//添加跳转深度卡片信息事件
|
this.AddDetailInfoEvent(i_device);
|
}
|
|
#endregion
|
|
#region ■ 深度卡片信息_______________________
|
|
/// <summary>
|
/// 添加跳转深度卡片信息事件
|
/// </summary>
|
private void AddDetailInfoEvent(CommonDevice i_device)
|
{
|
//深度卡片信息
|
this.ButtonClickEvent += (sender, e) =>
|
{
|
Common.CommonPage.Instance.IsDrawerLockMode = true;
|
//晾衣架类型的深度卡片界面
|
var form = new MainPage.ControlForm.DeviceAirerDetailCardForm();
|
form.RowOrCardControl = this;
|
form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
|
form.FormCloseEvent += this.CardDetailInfoBackEvent;
|
};
|
}
|
|
#endregion
|
|
#region ■ 检测设备打开状态___________________
|
|
/// <summary>
|
/// 检测设备打开状态
|
/// </summary>
|
/// <param name="i_device"></param>
|
/// <returns></returns>
|
public override bool CheckIsOpenStatu(CommonDevice i_device)
|
{
|
bool isOpen = false;
|
var airer = device as Airer;
|
if (airer.OnOffStatus == 1
|
|| airer.DryOnOffStatus == 1 ||
|
airer.WindOnOffStatus == 1 ||
|
airer.DisinfectOnOffStatus == 1)
|
{
|
isOpen = true;
|
}
|
return isOpen;
|
}
|
|
#endregion
|
|
#region ■ 发送获取状态命令___________________
|
|
/// <summary>
|
/// 发送获取状态命令
|
/// </summary>
|
public override void SendStatuComand()
|
{
|
if (Common.Config.Instance.Home.IsVirtually == true)
|
{
|
//如果住宅为虚拟住宅,则此功能无效
|
return;
|
}
|
//检测能否发送获取状态命令
|
if (this.CheckCanSendStatuComand() == true)
|
{
|
for (int i = 2; i < 6; i++)
|
{
|
//注意,衣架中的状态由不同端点获取
|
//回路2:读取照明开关状态
|
//回路3:读取风干开关状态和时间值
|
//回路4:读取烘干开关状态和时间值
|
//回路5:读取消毒开关状态和时间值
|
HdlDeviceAttributeLogic.Current.SendAirerComand(this.device, i);
|
}
|
}
|
}
|
|
#endregion
|
}
|
}
|