From 4d14154c36ac5692aadc036eed97fb9f1c410e2a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期日, 23 五月 2021 14:46:03 +0800
Subject: [PATCH] Merge branch 'WJC' into temp-wxr
---
HDL_ON/Entity/Function/Scene.cs | 72 ++++++++++++++++++++++++++++++++++--
1 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index 6f15f57..cc4379a 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
@@ -66,7 +67,7 @@
/// </summary>
public string delay = "0";
/// <summary>
- /// 鍦烘櫙鐨勬渶濂戒竴娆℃墽琛屾椂闂�
+ /// 鍦烘櫙鐨勬渶鍚庝竴娆℃墽琛屾椂闂�
/// </summary>
public string LastExecutionTime = "";
@@ -82,6 +83,11 @@
/// 鏀惰棌鏍囪
/// </summary>
public bool collect = false;
+
+ /// <summary>
+ /// 鍒涘缓璇ュ満鏅殑鐢ㄦ埛ID
+ /// </summary>
+ public string userId = "";
///// <summary>
///// 鍦烘櫙鑳屾櫙
@@ -137,13 +143,14 @@
sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2");
- if (sTimeSpan.Length > 8)
+ if (sTimeSpan.Length >= 8)
{
sTimeSpan = sTimeSpan.Substring(0, 8);
}
else
{
- sTimeSpan = "00000000";
+ sTimeSpan = Guid.NewGuid().ToString().Substring(0, 8);
+ //sTimeSpan = "00000000";
}
sceneId = sOidBeginsWith + sTimeSpan;
@@ -339,7 +346,14 @@
/// </summary>
public string GetDelayText()
{
- string text = "";
+ var delayInt = 0;
+ int.TryParse(delay,out delayInt);
+ if(delayInt == 0)
+ {
+ return Language.StringByID(StringId.NoDelay);
+ }
+ string text = (delayInt / 60)+Language.StringByID(StringId.m)+(delayInt % 60)+Language.StringByID(StringId.s);
+ return text;
switch (delay)
{
case "0":
@@ -368,6 +382,8 @@
/// 浜戠鏁版嵁淇敼鐨勬渶鍚庢椂闂�
/// </summary>
public string modifyTime = "";
+
+
}
/// <summary>
/// 鍦烘櫙鍔熻兘瀵硅薄
@@ -409,6 +425,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>
--
Gitblit v1.8.0