From d72ca686a3e262693f8a6e45e747e8e8da43335b Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 06 七月 2021 09:39:03 +0800 Subject: [PATCH] 2021-07-06 1.更新 --- HDL_ON/Entity/Function/Scene.cs | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 54 insertions(+), 3 deletions(-) diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index 386ded3..3970bc1 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using HDL_ON.Common; using HDL_ON.DAL.Server; +using HDL_ON.UI; using Shared; namespace HDL_ON.Entity @@ -368,6 +369,8 @@ /// 浜戠鏁版嵁淇敼鐨勬渶鍚庢椂闂� /// </summary> public string modifyTime = ""; + + } /// <summary> /// 鍦烘櫙鍔熻兘瀵硅薄 @@ -409,6 +412,54 @@ return localFunction; } + + /// <summary> + /// 瑙f瀽鍦烘櫙鍔熻兘鏁版嵁 + /// </summary> + /// <param name="sceneFunction"></param> + public string GetFunctionScnenInfo() + { + var sceneFunctionInfo = ""; + foreach (var sfs in status) + { + if (sfs.key == FunctionAttributeKey.OnOff) + { + if (sfs.value == "off") + return Language.StringByID(StringId.Close); + } + } + sceneFunctionInfo += Language.StringByID(StringId.Open) + " "; + + var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode); + var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); + var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); + if (modeState != null) + { + sceneFunctionInfo += modeState.GetValueText() + " "; + } + if (tempState != null) + { + sceneFunctionInfo += tempState.GetValueText() + " "; + sceneFunctionInfo += tempState.GetUintString(); + } + if (fanState != null) + { + sceneFunctionInfo += fanState.GetValueText() + " "; + } + var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); + if (briState != null) + { + sceneFunctionInfo += briState.value + "%"; + } + var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent); + if (perState != null) + { + sceneFunctionInfo += perState.value + "%"; + } + return sceneFunctionInfo; + } + + } /// <summary> @@ -446,7 +497,7 @@ case FunctionAttributeKey.SetTemp: text = Language.StringByID(StringId.Temp); break; - case FunctionAttributeKey.IndoorTemp: + case FunctionAttributeKey.RoomTemp: text = Language.StringByID(StringId.IndoorTemp); break; case FunctionAttributeKey.Delay: @@ -475,7 +526,7 @@ switch (key) { case FunctionAttributeKey.SetTemp: - case FunctionAttributeKey.IndoorTemp: + case FunctionAttributeKey.RoomTemp: us = "掳C"; break; case FunctionAttributeKey.Percent: @@ -500,7 +551,7 @@ text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF); break; case FunctionAttributeKey.SetTemp: - case FunctionAttributeKey.IndoorTemp: + case FunctionAttributeKey.RoomTemp: case FunctionAttributeKey.Brightness: case FunctionAttributeKey.Percent: if (value == "") -- Gitblit v1.8.0