From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirerRowControl.cs |  193 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 193 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirerRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirerRowControl.cs
new file mode 100644
index 0000000..68e2b5b
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirerRowControl.cs
@@ -0,0 +1,193 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+namespace Shared.Phone.Category.Controls
+{
+  /// <summary>
+  /// 鍒嗙被鐣岄潰鐨勬櫨琛f灦璁惧琛屾帶浠�
+  /// </summary>
+  public class DeviceAirerRowControl : DeviceRowCommon
+  {
+    #region 鈻� 鍙橀噺澹版槑___________________________
+
+    /// <summary>
+    /// 鎵撳紑鎺т欢
+    /// </summary>
+    private MostRightIconControl btnOpen = null;
+    /// <summary>
+    /// 鍋滄鎺т欢
+    /// </summary>
+    private MostRightIconControl btnStop = null;
+    /// <summary>
+    /// 鍏抽棴鎺т欢
+    /// </summary>
+    private MostRightIconControl btnClose = null;
+    #endregion
+
+    #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);
+
+      //鎵撳紑鎺т欢
+      this.btnOpen = new MostRightIconControl(69, 69);
+      btnOpen.btnIcon.UseClickStatu = true;
+      this.frameTable.AddChidren(btnOpen, ChidrenBindMode.NotBind);
+      btnOpen.InitControl();
+      btnOpen.X = Application.GetRealWidth(625) - btnOpen.XOffset;
+      btnOpen.ButtonClickEvent += (sender, e) =>
+      {
+        ((Airer)i_device).AirerUpDownStopControl(0);
+        base.RefreshControlInfo(i_device);
+        return;
+      };
+
+      //鍋滄鎺т欢
+      this.btnStop = new MostRightIconControl(69, 69);
+      btnStop.btnIcon.UseClickStatu = true;
+      btnStop.UnSelectedImagePath = "Airer/StopOffline.png";
+      btnStop.SelectedImagePath = "Airer/Stop.png";
+      this.frameTable.AddChidren(btnStop, ChidrenBindMode.NotBind);
+      btnStop.InitControl();
+      btnStop.X = Application.GetRealWidth(769) - btnOpen.XOffset;
+      btnStop.ButtonClickEvent += (sender, e) =>
+      {
+        //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁�
+        if (Common.Config.Instance.Home.IsVirtually == false)
+        {
+          ((Airer)i_device).AirerUpDownStopControl(2);
+        }
+      };
+
+      //鍏抽棴
+      this.btnClose = new MostRightIconControl(69, 69);
+      btnClose.btnIcon.UseClickStatu = true;
+      this.frameTable.AddChidren(btnClose, ChidrenBindMode.NotBind);
+      btnClose.InitControl();
+      btnClose.X = Application.GetRealWidth(896) - btnOpen.XOffset;
+      btnClose.ButtonClickEvent += (sender, e) =>
+      {
+        ((Airer)i_device).AirerUpDownStopControl(1);
+        base.RefreshControlInfo(i_device);
+        return;
+      };
+
+      //鍒锋柊鍥炬爣鎺т欢鐨勫浘鏍�
+      this.RefreshIconControlImage(i_device);
+    }
+
+    #endregion
+
+    #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+    /// <summary>
+    /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+    /// </summary>
+    private void AddDetailInfoEvent(CommonDevice i_device)
+    {
+      //娣卞害鍗$墖淇℃伅
+      this.frameTable.ButtonClickEvent += (sender, e) =>
+      {
+        //鏅捐。鏋剁被鍨嬬殑娣卞害鍗$墖鐣岄潰
+        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
+
+    #region 鈻� 鍒锋柊鎺т欢鐘舵�乢______________________ 
+    /// <summary>
+    /// 鍒锋柊鎺т欢鐘舵��
+    /// </summary>
+    /// <param name="i_device"></param>
+    public override void RefreshControlInfo(CommonDevice i_device)
+    {
+      //鍒锋柊鍥炬爣鎺т欢鐨勫浘鏍�
+      this.RefreshIconControlImage(i_device);
+      base.RefreshControlInfo(i_device);
+    }
+    #endregion
+
+    #region 鈻� 涓�鑸柟娉昣__________________________ 
+    /// <summary>
+    /// 鍒锋柊鍥炬爣鎺т欢鐨勫浘鏍�
+    /// </summary>
+    /// <param name="i_device"></param>
+    private void RefreshIconControlImage(CommonDevice i_device)
+    {
+      //杩樻病鏈夊垵濮嬪寲瀹屾垚
+      if (btnOpen == null) { return; }
+      btnOpen.UnSelectedImagePath = "Airer/UpOffline.png";
+      btnOpen.SelectedImagePath = "Airer/Up.png";
+      btnClose.UnSelectedImagePath = "Airer/DownOffline.png";
+      btnClose.SelectedImagePath = "Airer/Down.png";
+    }
+    #endregion
+  }
+}

--
Gitblit v1.8.0