From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 01 六月 2020 14:59:39 +0800
Subject: [PATCH] 上传一个合并的版本

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
index 542282a..cdb3057 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
@@ -109,8 +109,8 @@
         {
             //寮�鍏崇殑鑳屾櫙鍥剧墖
             var picSwitchBack = new FrameLayout();
-            picSwitchBack.Height = Application.GetMinRealAverage(579);
-            picSwitchBack.Width = Application.GetMinRealAverage(579);
+            picSwitchBack.Height = this.GetPictrueRealSize(579);
+            picSwitchBack.Width = this.GetPictrueRealSize(579);
             picSwitchBack.Y = Application.GetRealHeight(340);
             picSwitchBack.BackgroundImagePath = "Light/OnOff.png";
             picSwitchBack.Gravity = Gravity.CenterHorizontal;
@@ -120,8 +120,8 @@
             var btnClose = new IconViewControl(81);
             btnClose.UnSelectedImagePath = "Light/OFF.png";
             btnClose.SelectedImagePath = "Light/OFFSelected.png";
-            btnClose.X = Application.GetMinRealAverage(101);
-            btnClose.Y = Application.GetMinRealAverage(248);
+            btnClose.X = this.GetPictrueRealSize(101);
+            btnClose.Y = this.GetPictrueRealSize(248);
             picSwitchBack.AddChidren(btnClose);
             listControl.Add(btnClose);
 
@@ -129,7 +129,7 @@
             var btnOpen = new IconViewControl(81);
             btnOpen.UnSelectedImagePath = "Light/ON.png";
             btnOpen.SelectedImagePath = "Light/ONSelected.png";
-            btnOpen.X = Application.GetMinRealAverage(397);
+            btnOpen.X = this.GetPictrueRealSize(397);
             btnOpen.Y = btnClose.Y;
             picSwitchBack.AddChidren(btnOpen);
             listControl.Add(btnOpen);
@@ -246,11 +246,7 @@
         /// <returns></returns>
         public override bool CheckResponeResultStatu(ReceiveComandDiv comandDiv, CommonDevice report)
         {
-            if (comandDiv == ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉)
-            {
-                return true;
-            }
-            else if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�)
+            if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�)
             {
                 HdlThreadLogic.Current.RunMain(() =>
                 {
@@ -259,6 +255,7 @@
                     //璁剧疆鐘舵�佹枃瀛�
                     this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                 });
+                return true;
             }
             return false;
         }
@@ -273,6 +270,16 @@
         /// <param name="isOpen"></param>
         private void SetSwitchCommand(bool isOpen)
         {
+            //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�
+            if (Common.Config.Instance.Home.IsVirtually == true)
+            {
+                ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
+                //鍙樻洿鍗$墖鐘舵��
+                this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
+                //璁剧疆鐘舵�佹枃瀛�
+                this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
+                return;
+            }
             //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
             this.StartCheckResponeResult(this.listControl, (result) =>
             {

--
Gitblit v1.8.0