From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期四, 16 四月 2020 17:10:57 +0800 Subject: [PATCH] 请合并代码 --- ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 104 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs new file mode 100755 index 0000000..7094af3 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs @@ -0,0 +1,104 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.MainPage.Controls +{ + /// <summary> + /// 绌鸿皟鍗$墖鐨勬帶浠� + /// </summary> + public class DeviceAcCardControl : DeviceCardCommon + { + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栨帶浠� + /// </summary> + /// <param name="i_device"></param> + public override void InitControl(CommonDevice i_device) + { + base.InitControl(i_device); + + //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 + this.AddDetailInfoEvent(i_device); + + //娣诲姞寮�鍏虫帶浠� + var btnSwitch = this.AddSwitchControl(); + btnSwitch.ButtonClickEvent += (sender, e) => + { + bool setStatu = !btnSwitch.IsSelected; + //鍙樻洿鍗$墖鐘舵�� + this.SetCardOpenStatu(setStatu); + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 + this.StartCheckResponeResult(!setStatu); + + if (setStatu == true) + { + //鎵撳紑 + this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1)); + (i_device as AC).Open(); + } + else + { + //鍏抽棴 + this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close)); + (i_device as AC).Close(); + } + }; + } + + #endregion + + #region 鈻� 娣卞害鍗$墖淇℃伅_______________________ + + /// <summary> + /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 + /// </summary> + private void AddDetailInfoEvent(CommonDevice i_device) + { + //娣卞害鍗$墖淇℃伅 + this.ButtonClickEvent += (sender, e) => + { + Common.CommonPage.Instance.IsDrawerLockMode = true; + + //绌鸿皟绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� + var form = new ControlForm.DeviceAcDetailCardForm(); + form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, 1457); + form.FormCloseEvent += this.CardDetailInfoBackEvent; + }; + } + + #endregion + + #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________ + + /// <summary> + /// 妫�娴嬭澶囨墦寮�鐘舵�� + /// </summary> + /// <param name="i_device"></param> + /// <returns></returns> + public override bool CheckIsOpenStatu(CommonDevice i_device) + { + return ((AC)i_device).currentSystemMode != 0; + } + + #endregion + + #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________ + + /// <summary> + /// 鍙戦�佽幏鍙栫姸鎬佸懡浠� + /// </summary> + public override void SendStatuComand() + { + //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� + if (this.CheckCanSendStatuComand() == true) + { + Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendACStatuComand(this.device); + } + } + + #endregion + } +} -- Gitblit v1.8.0