From b69d7735274b8d0f741da8a6bb8b8e1347477a5a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 19 三月 2020 17:14:16 +0800
Subject: [PATCH] 20200319

---
 HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/Room/FunctionDivBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
similarity index 80%
rename from HDL_ON/UI/UI2/2-Classification/Room/FunctionDivBLL.cs
rename to HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
index 5e845c5..76258c9 100644
--- a/HDL_ON/UI/UI2/2-Classification/Room/FunctionDivBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -4,7 +4,7 @@
 
 namespace HDL_ON.UI
 {
-    public partial class RoomControlZone
+    public partial class FunctionControlZone
     {
         /// <summary>
         /// 鍔犺浇鍔熻兘鏀惰棌鎸夐挳浜嬩欢
@@ -18,6 +18,7 @@
             };
         }
         #region 鐏厜鐨勪簨浠跺垪琛�
+
         /// <summary>
         /// 鐏厜寮�鍏充簨浠�
         /// </summary>
@@ -28,9 +29,12 @@
                 btnSwitch.IsSelected = !btnSwitch.IsSelected;
                 new System.Threading.Thread(() =>
                 {
-                    var light = function as Light;
-                    light.state = btnSwitch.IsSelected ? 1 : 0;
-                    Control.Send("write", function, 3);
+                    if (function.functionCategory == FunctionType.Light)
+                    {
+                        var light = function as Light;
+                        light.on_off = btnSwitch.IsSelected ? 1 : 0;
+                        Control.Send("write", function);
+                    }
                 })
                 { IsBackground = true }.Start();
             };
@@ -54,8 +58,8 @@
                     {
                         new System.Threading.Thread(() =>
                         {
-                            light.dicPropert["brightness"] = (byte)e;
-                            Control.Send("write", function, 3);
+                            light.brightness = e;
+                            Control.Send("write", function);
                             dimmerControlBar.Tag = DateTime.Now;
                         })
                         { IsBackground = true }.Start();
@@ -63,8 +67,8 @@
                 };
                 dimmerControlBar.MouseUpEventHandler += (sender, e) =>
                 {
-                    light.dicPropert["brightness"] = (byte)dimmerControlBar.Progress;
-                    Control.Send("write", function, 3);
+                    light.brightness = dimmerControlBar.Progress;
+                    Control.Send("write", function);
                 };
             }
         }
@@ -111,11 +115,17 @@
                         MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                         break;
                     case "Curtain":
-                        var curtainView = new CurtainModulePage (function);
+                        var curtainView = new CurtainModulePage(function);
                         MainPage.BasePageView.AddChidren(curtainView);
                         curtainView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                         MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                         break;
+                    case "AC":
+                        var acView = new ACPage(function);
+                        MainPage.BasePageView.AddChidren(acView);
+                        acView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        break;
                 }
             };
             this.MouseUpEventHandler = eventHandler;

--
Gitblit v1.8.0