From 43b0d5870d528f23ecd6aeceb6cfd4325188b46f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 01 七月 2021 15:50:43 +0800 Subject: [PATCH] Revert "1" --- 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 old mode 100755 new mode 100644 index ee1da9d..630b044 --- 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