wxr
2020-03-19 b69d7735274b8d0f741da8a6bb8b8e1347477a5a
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();
            };