From a469a96ee8c38f7d98366dcd633e3a15f92fec65 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 01 三月 2021 17:53:52 +0800 Subject: [PATCH] 2021-3-1-1 --- HDL_ON/Entity/Function/Light.cs | 43 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 39 insertions(+), 4 deletions(-) diff --git a/HDL_ON/Entity/Function/Light.cs b/HDL_ON/Entity/Function/Light.cs index f9843cb..d430811 100644 --- a/HDL_ON/Entity/Function/Light.cs +++ b/HDL_ON/Entity/Function/Light.cs @@ -96,10 +96,44 @@ /// </summary> [Newtonsoft.Json.JsonIgnore] public int lastBrightness = 100; + + int hadFadeTime = 99; + /// <summary> + /// 鏄惁鎷ユ湁娓愬彉鏃堕棿 + /// </summary> + public bool HadFadeTime + { + get + { + if (hadFadeTime == 99) + { + var t = attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime); + if (t == null) + { + hadFadeTime = 0; + return false; + } + else + { + hadFadeTime = 1; + return true; + } + } + if (hadFadeTime == 1) + { + return true; + } + else + { + return false; + } + } + } + [Newtonsoft.Json.JsonIgnore] FunctionAttributes trait_fadeTime; /// <summary> - /// 浜害鍊� + /// 娓愬彉鏃堕棿 /// </summary> [Newtonsoft.Json.JsonIgnore] public int fadeTime @@ -176,10 +210,10 @@ } if (trait_color.curValue.ToString() == "{}") trait_color.curValue = "255,255,255"; - int.TryParse(trait_color.curValue.ToString().Split(",")[0], out redColor); - int.TryParse(trait_color.curValue.ToString().Split(",")[1], out greenColor); - int.TryParse(trait_color.curValue.ToString().Split(",")[2], out blueColor); } + int.TryParse(trait_color.curValue.ToString().Split(",")[0], out redColor); + int.TryParse(trait_color.curValue.ToString().Split(",")[1], out greenColor); + int.TryParse(trait_color.curValue.ToString().Split(",")[2], out blueColor); int recolor = redColor * 256 * 256 + greenColor * 256 + blueColor; @@ -202,6 +236,7 @@ redColor = color[0]; greenColor = color[1]; blueColor = color[2]; + trait_color.curValue = redColor + "," + greenColor + "," + blueColor; } [Newtonsoft.Json.JsonIgnore] -- Gitblit v1.8.0