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/Curtain.cs | 69 ++--------------------------------
1 files changed, 4 insertions(+), 65 deletions(-)
diff --git a/HDL_ON/Entity/Function/Curtain.cs b/HDL_ON/Entity/Function/Curtain.cs
index ee1da9d..630b044 100644
--- a/HDL_ON/Entity/Function/Curtain.cs
+++ b/HDL_ON/Entity/Function/Curtain.cs
@@ -4,73 +4,12 @@
namespace HDL_ON.Entity
{
- public class Curtain : Function
+ public class Curtain
{
- /*
- 绐楀笜灞炴�у垪琛細trait: [switch,percent,lock]
- 灞炴�� 鎻忚堪
- on_off on/off/stop;
- percent 0-100;
- lock boolean (Lock閿佸畾鎺у埗)
- */
- public Curtain()
+ public int GetPercent(Function function)
{
- }//percent
- [Newtonsoft.Json.JsonIgnore]
- public FunctionAttributes trait_percent;
- /// <summary>
- /// 寮�鍏崇櫨鍒嗘瘮
- /// 0-100
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int percent
- {
- get
- {
- try
- {
- if(trait_percent==null)
- {
- trait_percent = attributes.Find((obj) => obj.key == "percent");
- if (trait_percent == null)
- {
- trait_percent = new FunctionAttributes()
- {
- key = "percent",
- value = new List<string> { "up", "down" },
- max = 100,
- min = 0,
- curValue = 0
- };
- }
- if (trait_percent.curValue.ToString() == "{}")
- trait_percent.curValue = 0;
- }
- string textValue = trait_percent.curValue.ToString();
- if (textValue == string.Empty)
- {
- trait_percent.curValue = 0;
- }
- return Convert.ToInt32( trait_percent.curValue);
- }
- catch
- {
- MainPage.Log("percent 鏁版嵁鑾峰彇澶辫触.");
- return 0;
- }
- }
- set
- {
- try
- {
- trait_percent.curValue = value;
- }
- catch
- {
- MainPage.Log("percent 鏁版嵁鍒锋柊澶辫触.");
- }
- }
+ return Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Percent));
}
-
+
}
}
--
Gitblit v1.8.0