wjc
2023-03-28 a9d1161b1df96e7ddad566335989a1444e433ef5
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using Shared;
@@ -62,11 +63,21 @@
        {
            btnSwitchIcon.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                    return;
                }
                btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected;
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
@@ -74,6 +85,16 @@
            };
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                    return;
                }
                btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected;
                new System.Threading.Thread(() =>
                {