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/FuntionControlView/Light/RelayPageBLL.cs |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
index 769d4f9..0bf825b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -5,6 +5,7 @@
 {
     public partial class RelayPage
     {
+
         /// <summary>
         /// 鍔犺浇浜嬩欢鍒楄〃
         /// </summary>
@@ -12,6 +13,12 @@
         {
             LoadSwitchEvent();
             LoadCollectionEvent();
+
+            //鍥為��鍒锋柊淇℃伅浜嬩欢
+            actionRefresh = () => {
+                btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
+                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
+            };
         }
 
         /// <summary>
@@ -20,7 +27,7 @@
         void LoadCollectionEvent()
         {
             btnCollection.MouseUpEventHandler += (sender, e) => {
-                btnCollection.IsSelected = light.collection = !btnCollection.IsSelected;
+                btnCollection.IsSelected = light.collection = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                 DB_ResidenceData.residenceData.SaveResidenceData();
             };
         }
@@ -37,8 +44,8 @@
                 new System.Threading.Thread(() =>
                 {
                     var light = this.light as Light;
-                    light.state = btnSwitch.IsSelected ? 1 : 0;
-                    Control.Send("write", this.light, 3);
+                    light.on_off = btnSwitch.IsSelected ? 1 : 0;
+                    Control.Send("write", this.light);
                 })
                 { IsBackground = true }.Start();
             };
@@ -49,8 +56,8 @@
                 new System.Threading.Thread(() =>
                 {
                     var light = this.light as Light;
-                    light.state = btnSwitch.IsSelected ? 1 : 0;
-                    Control.Send("write", this.light, 3);
+                    light.on_off = btnSwitch.IsSelected ? 1 : 0;
+                    Control.Send("write", this.light);
                 })
                 { IsBackground = true }.Start();
             };

--
Gitblit v1.8.0