wxr
2023-11-06 07c91e3b27d10bad17ad2f805aab7b74e24fad2b
HDL_ON/Entity/Function/Scene.cs
@@ -3,6 +3,7 @@
using HDL_ON.Common;
using HDL_ON.DAL.Server;
using HDL_ON.UI;
using HDL_ON.UI.UI2.Intelligence.Automation;
using Shared;
namespace HDL_ON.Entity
@@ -561,10 +562,23 @@
        /// <returns></returns>
        private Function ConvertFunctionObject()
        {
            if (type == "7")
            {
                var logic = Logic.LogicList.Find((obj) => obj.sid == sid);
                if (logic != null) {
                    _localFunction = new Function()
                    {
                        name = logic.name
                    };
                }
            }
            else
            {
            var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
            if(localFunction == null)
            {
                localFunction = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
                }
            }
            return localFunction;
        }
@@ -577,6 +591,23 @@
        public string GetFunctionScnenInfo()
        {
            var sceneFunctionInfo = "";
            if (type == "7")
            {
                foreach (var sfs in status)
                {
                    if (sfs.key == "enable")
                    {
                        if (sfs.value == "true")
                            return Language.StringByID(StringId.OpenArm);
                        else
                        {
                            return Language.StringByID(StringId.Close);
                        }
                    }
                }
            }
            else
            {
            foreach (var sfs in status)
            {
                if (sfs.key == FunctionAttributeKey.OnOff)
@@ -663,6 +694,7 @@
            {
                sceneFunctionInfo += " " + perSongName.value;
            }
            }
            return sceneFunctionInfo;
        }
@@ -670,6 +702,8 @@
        /// 设备
        /// 场景 =scene
        /// 群控=5
        /// 自动化=7
        ///
        /// </summary>
        public string type = "0";
    }