| | |
| | | using System;
|
| | | using Shared.Phone.UserCenter;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using ZigBee.Device;
|
| | |
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | | public override void InitControl(CommonDevice i_device)
|
| | | public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom)
|
| | | {
|
| | | base.InitControl(i_device);
|
| | | base.InitControl(i_device, i_nowSelectRoom);
|
| | |
|
| | | //添加跳转深度卡片信息事件
|
| | | this.AddDetailInfoEvent(i_device);
|
| | |
| | | var btnSwitch = this.AddSwitchControl();
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //如果住宅为虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //直接变更缓存
|
| | | ((Rollershade)i_device).WcdCurrentPositionLiftPercentage = btnSwitch.IsSelected == true ? 0 : 100;
|
| | | this.RefreshControlInfo(this.device);
|
| | | return;
|
| | | }
|
| | |
|
| | | bool setStatu = !btnSwitch.IsSelected;
|
| | | //变更卡片状态
|
| | | this.SetCardOpenStatu(setStatu);
|
| | |
| | | //深度卡片信息
|
| | | this.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
|
| | | UserView.HomePage.Instance.AddChidren(rollerShadeControl);
|
| | | UserView.HomePage.Instance.PageIndex += 1;
|
| | | UserView.HomePage.Instance.ScrollEnabled = false;
|
| | | rollerShadeControl.IsDrawerLockMode = true;
|
| | | rollerShadeControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
|
| | | rollerShadeControl.action += this.CardDetailInfoBackEvent;
|
| | | Common.CommonPage.Instance.IsDrawerLockMode = true;
|
| | | //窗帘类型的深度卡片界面
|
| | | var form = new ControlForm.DeviceCurtainDetailCardForm();
|
| | | form.RowOrCardControl = this;
|
| | | form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
|
| | | form.FormCloseEvent += this.CardDetailInfoBackEvent;
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | /// <returns></returns>
|
| | | public override bool CheckIsOpenStatu(CommonDevice i_device)
|
| | | {
|
| | | return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 10;
|
| | | return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 0;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | public override void SendStatuComand()
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | return;
|
| | | }
|
| | | //检测能否发送获取状态命令
|
| | | if (this.CheckCanSendStatuComand() == true)
|
| | | {
|
| | | Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(this.device);
|
| | | HdlDeviceAttributeLogic.Current.SendCurtainStatuComand(this.device);
|
| | | }
|
| | | if (((Rollershade)this.device).WcdType == -1)
|
| | | {
|