From 320d7cc8feb394d0ce3db2ec1d01593b554d990f Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期三, 23 十二月 2020 10:57:13 +0800 Subject: [PATCH] 2020-12-23 1.更新 --- HDL_ON/Entity/Function/Function.cs | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 6fe0d9a..8e666a9 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -162,7 +162,7 @@ { if (_trait_on_off == null) { - _trait_on_off = attributes.Find((obj) => obj.key == "on_off"); + _trait_on_off = attributes.Find((obj) => obj.key == FunctionAttributeKey.OnOff); //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂�� if (_trait_on_off == null) { @@ -173,8 +173,12 @@ max = 1, min = 0, }; - _trait_on_off.curValue = "on"; + _trait_on_off.curValue = "off"; } + } + if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off") + { + _trait_on_off.curValue = "off"; } return _trait_on_off; } @@ -187,7 +191,7 @@ /// <summary> /// 浣跨敤娆℃暟 /// </summary> - public double usageCount = 0; + public double controlCounter = 0; /// <summary> /// 浣跨敤棰戠巼 /// </summary> @@ -195,7 +199,7 @@ { get { - return usageCount / 7; + return controlCounter / 7; } } /// <summary> @@ -297,7 +301,14 @@ //case FunctionAttributeKey.FadeTime: if (attr.curValue.ToString() == "{}") { - attr.curValue = "0"; + if (attr.key == FunctionAttributeKey.OnOff) + { + attr.curValue = "off"; + } + else + { + attr.curValue = "0"; + } } if (attr.key == FunctionAttributeKey.SetTemp) { -- Gitblit v1.8.0