From 688dbdb4cba154f1dfb60777b0413e0b1258542a Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 21 十二月 2020 09:45:33 +0800
Subject: [PATCH] 2020-12-21-1

---
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm                 |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs |   50 ++++++++----------------
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide                     |    0 
 .vs/HDL_APP_Project/xs/UserPrefs.xml                           |    4 +-
 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs |   28 ++++++++++++-
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal                 |    0 
 6 files changed, 44 insertions(+), 38 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 497ab98..ae25ce1 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -3,7 +3,7 @@
   <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs">
     <Files>
       <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs" Line="1" Column="1" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs" Line="1" Column="1" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs" Line="510" Column="22" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
@@ -41,7 +41,7 @@
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" />
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore>
       <Breakpoint file="/Users/hdl/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="133" column="1" />
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
index bc3c990..482232d 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
index 02b14f6..f81fdce 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
index 783b2ae..11e87e2 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
Binary files differ
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 7eee6bc..606fa03 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -260,7 +260,7 @@
                                     }
                                     break;
                                 case FunctionType.Curtain:
-                                    {//寮�鍏崇伅
+                                    {
                                         foreach (var dic in dicList)
                                         {
                                             string value = dic["value"];
@@ -288,48 +288,32 @@
                                     break;
                                 case FunctionType.MotorCurtain:
                                 case FunctionType.RollingShutter:
-                                    {//寮�鍏崇伅
+                                    {
                                         string on_off = GetKeyValue("on_off", dicList);
-                                        string brightness = GetKeyValue("brightness", dicList);
-                                        if (on_off != "")
+                                        string percent = GetKeyValue("percent", dicList);
+
+                                        if (on_off == "off")
                                         {
-                                            switch (on_off)
-                                            {
-                                                case "on":
-                                                    {
-                                                        stateStr = Language.StringByID(StringId.onLogic);
-                                                       
-                                                    }
-                                                    break;
-                                                case "off":
-                                                    {
-                                                        stateStr = Language.StringByID(StringId.offLogic);
-                                                       
-                                                    }
-                                                    break;
-                                                case "stop":
-                                                    {
-                                                        stateStr = Language.StringByID(StringId.stop);
-                                                    }
-                                                    break;
-                                            }
+                                            stateStr = Language.StringByID(StringId.offLogic);
                                         }
-                                        if (brightness != "")
+                                        else if (on_off == "stop")
                                         {
-                                            stateStr += brightness + "%";
+                                            stateStr = Language.StringByID(StringId.stop);
+                                        }
+                                        else if (on_off == "on" && percent != "")
+                                        {
+                                            stateStr = Language.StringByID(StringId.onLogic) + percent + "%";
 
                                         }
-
-                                        if (on_off != "" && on_off == "stop"|| on_off != "" && on_off == "off")
+                                        else if (on_off == "on")
                                         {
-                                            targetView.btnState.Text = Language.StringByID(StringId.stop);
+                                            stateStr = Language.StringByID(StringId.onLogic);
                                         }
-                                        else
+                                        else if (percent != "")
                                         {
-                                            targetView.btnState.Text = stateStr;
-
+                                            stateStr = percent + "%";
                                         }
-
+                                        targetView.btnState.Text = stateStr;
                                     }
                                     break;
                                 case FunctionType.AC: {
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index d19d608..bb58146 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -816,8 +816,30 @@
             #region 鐐瑰嚮浜嬩欢
             int brightnesValue = 0;
             Dictionary<string, string> dic = new Dictionary<string, string>();
-            LogicMethod.dictionary(dic, "key", "brightness");
-            string keyVlaue = "brightness";
+            string keyVlaue = "";
+
+            switch (device.functionType)
+            {
+                //寮�鍏崇伅鍏� light.Switch
+                case FunctionType.Dimmer:
+                case FunctionType.RGB:
+                case FunctionType.RGBW:
+                case FunctionType.ColorTemperature:
+                    {
+                        LogicMethod.dictionary(dic, "key", "brightness");
+                        keyVlaue = "brightness";
+                    }
+                    break;
+               
+                case FunctionType.MotorCurtain:
+                case FunctionType.RollingShutter:
+                    {
+                        LogicMethod.dictionary(dic, "key", "percent");
+                        keyVlaue = "percent";
+                    }
+                    break;
+            }
+            
             //鈥旂偣鍑讳簨浠�
             brightness.btn_subtract_click.MouseUpEventHandler += (sender2, e2) =>
             {
@@ -1006,7 +1028,7 @@
                                         }
                                     }
                                     break;
-                                case "brightness":
+                                case "percent":
                                     {
 
                                         button2.Text = value;

--
Gitblit v1.8.0