From e22fdb94322e6cec38e5e4a9aec13d431a133fde Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 28 四月 2020 16:32:35 +0800
Subject: [PATCH] 上传合并后的代码

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs |   98 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 90 insertions(+), 8 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
index 6b371cf..13fae51 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
@@ -84,7 +84,7 @@
             //娓呮礂婊ょ綉鎻愮ず鐨凢rameLayout
             this.frameClrean = new FrameLayout();
             frameClrean.Width = Application.GetRealWidth(600);
-            frameClrean.Height = Application.GetMinRealAverage(69);
+            frameClrean.Height = this.GetPictrueRealSize(69);
             frameClrean.X = ControlCommonResourse.XXLeft;
             frameClrean.Y = Application.GetRealHeight(35);
             frameWhiteBack.AddChidren(frameClrean);
@@ -117,8 +117,8 @@
             //绌鸿皟鎺т欢鐨勫鍣�
             var frameAcBack = new FrameLayout();
             frameAcBack.Y = Application.GetRealHeight(412);
-            frameAcBack.Width = Application.GetMinRealAverage(671);
-            frameAcBack.Height = Application.GetMinRealAverage(671);
+            frameAcBack.Width = this.GetPictrueRealSize(671);
+            frameAcBack.Height = this.GetPictrueRealSize(671);
             frameAcBack.Gravity = Gravity.CenterHorizontal;
             frameWhiteBack.AddChidren(frameAcBack);
 
@@ -146,7 +146,7 @@
 
             //绌鸿皟鎺т欢閲岄潰鐨勯偅涓樉绀哄埗鐑�,鍒跺喎鐨勬帶浠�
             this.btnNowModeView = new NormalViewControl(200, 55, true);
-            btnNowModeView.Y = Application.GetMinRealAverage(184);
+            btnNowModeView.Y = this.GetPictrueRealSize(184);
             btnNowModeView.Gravity = Gravity.CenterHorizontal;
             btnNowModeView.Text = DeviceAcDetailCardMethord.GetModeNameByModeId(deviceAc.currentSystemMode);
             btnNowModeView.TextSize = 12;
@@ -157,8 +157,8 @@
             this.btnReduce = new IconViewControl(81);
             btnReduce.CanClick = isAcOpen;
             btnReduce.UnSelectedImagePath = "AC/Reduce.png";
-            btnReduce.X = Application.GetMinRealAverage(132);
-            btnReduce.Y = Application.GetMinRealAverage(268);
+            btnReduce.X = this.GetPictrueRealSize(132);
+            btnReduce.Y = this.GetPictrueRealSize(268);
             frameAcBack.AddChidren(btnReduce);
             btnReduce.ButtonClickEvent += (sender, e) =>
             {
@@ -173,7 +173,7 @@
             this.btnAdd = new IconViewControl(81);
             btnAdd.CanClick = isAcOpen;
             btnAdd.UnSelectedImagePath = "AC/Add.png";
-            btnAdd.X = frameAcBack.Width - Application.GetMinRealAverage(81 + 132);
+            btnAdd.X = frameAcBack.Width - this.GetPictrueRealSize(81 + 132);
             btnAdd.Y = btnReduce.Y;
             frameAcBack.AddChidren(btnAdd);
             btnAdd.ButtonClickEvent += (sender, e) =>
@@ -187,7 +187,7 @@
 
             //鈩�
             var btnUint = new NormalViewControl(100, 66, true);
-            btnUint.Y = Application.GetMinRealAverage(366);
+            btnUint.Y = this.GetPictrueRealSize(366);
             btnUint.Gravity = Gravity.CenterHorizontal;
             btnUint.TextAlignment = TextAlignment.Center;
             btnUint.Text = "鈩�";
@@ -358,14 +358,35 @@
             //鍙戦�佽繘搴﹀��
             if (deviceAc.currentSystemMode == 3 || deviceAc.currentSystemMode == 8)
             {
+                //濡傛灉浣忓畢鏄櫄鎷熶綇瀹�
+                if (Common.Config.Instance.Home.IsVirtually == true)
+                {
+                    this.canSetProgress = true;
+                    deviceAc.currentCoolingSetpoint = value;
+                    return;
+                }
                 deviceAc.SetCoolingTemperatureAsync(value * 100);
             }
             else if (deviceAc.currentSystemMode == 4)
             {
+                //濡傛灉浣忓畢鏄櫄鎷熶綇瀹�
+                if (Common.Config.Instance.Home.IsVirtually == true)
+                {
+                    this.canSetProgress = true;
+                    deviceAc.currentHeatingSetpoint = value;
+                    return;
+                }
                 deviceAc.SetHeatingTemperatureAsync(value * 100);
             }
             else if (deviceAc.currentSystemMode == 1)
             {
+                //濡傛灉浣忓畢鏄櫄鎷熶綇瀹�
+                if (Common.Config.Instance.Home.IsVirtually == true)
+                {
+                    this.canSetProgress = true;
+                    deviceAc.currentAutoSetpoint = value;
+                    return;
+                }
                 deviceAc.SetAutoTemperatureAsync(value * 100);
             }
         }
@@ -480,6 +501,16 @@
         /// <param name="fanSwingMode">Fan mode.</param>
         private void SetFanSwingComand(AC.FanSwingMode fanSwingMode)
         {
+            //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛�
+            if (Common.Config.Instance.Home.IsVirtually == true)
+            {
+                deviceAc.currentFanSwingMode = (int)fanSwingMode;
+                var tempDevice = new CommonDevice();
+                tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 };
+                tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 4096 } };
+                this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice);
+                return;
+            }
             var oldModel = (AC.FanSwingMode)deviceAc.currentFanSwingMode;
             if (oldModel == fanSwingMode)
             {
@@ -645,6 +676,32 @@
                 //閫夋嫨鐨勬槸鍚屼竴涓�
                 return;
             }
+
+            //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛�
+            if (Common.Config.Instance.Home.IsVirtually == true)
+            {
+                deviceAc.currentSystemMode = (int)mode;
+                var tempDevice = new CommonDevice();
+                tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 };
+                tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } };
+                this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice);
+                //閫侀鐨勬椂鍊�,娌℃湁娓╁害鐨勬蹇�
+                if (mode == AC.AcMode.FanOnly)
+                {
+                    //鍔犲噺涓嶅彲浠ョ偣鍑�
+                    btnAdd.CanClick = false;
+                    btnReduce.CanClick = false;
+                }
+                //濡傛灉鍘熸潵鐨勭姸鎬佹槸閫侀鐨勮瘽
+                else if (oldModel == AC.AcMode.FanOnly)
+                {
+                    //鍔犲噺鍙互鐐瑰嚮
+                    btnAdd.CanClick = true;
+                    btnReduce.CanClick = true;
+                }
+                return;
+            }
+
             //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
             this.StartCheckResponeResult(this.listControl, (result) =>
             {
@@ -718,6 +775,20 @@
         /// <param name="isOpen"></param>
         private void SetSwitchComand(bool isOpen)
         {
+            //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛�
+            if (Common.Config.Instance.Home.IsVirtually == true)
+            {
+                deviceAc.currentSystemMode = isOpen == true ? 3 : 0;
+                var tempDevice = new CommonDevice();
+                tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 };
+                tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } };
+                this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice);
+                //鍔犲噺鏄惁鍙互鐐瑰嚮
+                btnAdd.CanClick = isOpen;
+                btnReduce.CanClick = isOpen;
+                return;
+            }
+
             //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
             this.StartCheckResponeResult(this.listControl, (result) =>
             {
@@ -853,6 +924,17 @@
             rowFrame.ButtonClickEvent += (sender, e) =>
             {
                 ((DialogCommonForm)frameBack.Parent.Parent).CloseForm();
+
+                //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛�
+                if (Common.Config.Instance.Home.IsVirtually == true)
+                {
+                    deviceAc.currentFanMode = (int)i_div;
+                    var tempDevice = new CommonDevice();
+                    tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 };
+                    tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 0 } };
+                    this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice);
+                    return;
+                }
                 //鍙戦�侀閫熷懡浠�
                 this.SetAcWindSpeedComand(i_div);
             };

--
Gitblit v1.8.0