From d76b0e40e5bb127fd33aa1f7842447a1df0628d5 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期日, 30 七月 2023 22:16:34 +0800
Subject: [PATCH] Update PublicAssmeblyBLL.cs

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs |   37 +++++++++++++++++--------------------
 1 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index 8b698be..26c55dc 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -58,7 +58,7 @@
             {
                 //缇ゆ帶
                 case SPK.GroupControl:
-                    int bottom = 50;
+                    int height = Application.GetRealHeight(50);
                     int attributesNameId=0;
                     int count = 0;
                     foreach (var attr in (device as GroupControl).attributes)
@@ -71,7 +71,7 @@
                         {
                             LogicView.FunTypeView view = new LogicView.FunTypeView();
                             view.btnState.Name = "缇ゆ帶";
-                            view.frameLayout.Y = count * Application.GetRealHeight(50);
+                            view.frameLayout.Y = count * height;
                             fLayout.AddChidren(view.FLayoutView());
                             count++;
                             switch (attr.key)
@@ -118,6 +118,7 @@
                                     break;
                                 case FunctionAttributeKey.Colorful:
                                     attributesNameId = StringId.ColorfulFunction;
+                                    view.btnState.Name = "colorful";
                                     ///寮�鍏崇偣鍑讳簨浠�
                                     view.btnClick.MouseUpEventHandler += (sender, e) =>
                                     {
@@ -129,13 +130,13 @@
                             if (edit)
                             {
                                 //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
-                                GetEditDeviceState(device, index, view.btnState, null, null, null);
+                                GetEditDeviceState(device, index, view.btnState, null, null, null, attr.key);
                             }
                         }
                     }
 
                     //璁惧寤舵椂iewv
-                    DelayView(fLayout, Application.GetRealHeight(50)* count);
+                    DelayView(fLayout, height* count);
                     break;
                 //鎻掑骇(鏈塙SB)
                 case SPK.PanelSocket:
@@ -468,12 +469,7 @@
                         };
                         int min = device.GetAttribute("set_temp") == null ? 16 : device.GetAttribute("set_temp").min;
                         int max = device.GetAttribute("set_temp") == null ? 32 : device.GetAttribute("set_temp").max;
-                        string unit = device.GetAttribute("temperature_type") == null ? "鈩�" : device.GetAttribute("temperature_type").state;
-                        if (string.IsNullOrEmpty(unit))
-                        {
-                            //璋冭瘯杞欢鏈夌┖鑳戒笂浼犱负绌�
-                            unit = "鈩�";
-                        }
+                        string unit = InpOrOutLogicMethod.Current.GetTemperatureUnit(device);
                         ///娓╁害鐐瑰嚮浜嬩欢
                         temperatureView.btnClick.MouseUpEventHandler += (sender, e) =>
                         {
@@ -490,7 +486,7 @@
                                 string set_temp_value = stateStr.Replace(unit, "");
                                 //鏁版嵁灏佽
                                 AddDictionary(keyVlaue, set_temp_value);
-                            }, min,max, unit);
+                            }, min, max, unit);
 
                         };
                         ///妯″紡鐐瑰嚮浜嬩欢
@@ -579,11 +575,7 @@
                         {
                             int min = device.GetAttribute("set_temp") == null ? 16 : device.GetAttribute("set_temp").min;
                             int max = device.GetAttribute("set_temp") == null ? 32 : device.GetAttribute("set_temp").max;
-                            string unit = device.GetAttribute("temperature_type") == null ? "鈩�" : device.GetAttribute("temperature_type").state;
-                            if (string.IsNullOrEmpty(unit)) {
-                                //璋冭瘯杞欢鏈夌┖鑳戒笂浼犱负绌�
-                                unit = "鈩�";
-                            }
+                            string unit = InpOrOutLogicMethod.Current.GetTemperatureUnit(device);
                             string tempValue = temperatureView.btnState.Text;
                             LogicView.TemperatureView tempView = new LogicView.TemperatureView();
                             tempView.FLayoutView(this, tempValue, (stateStr) =>
@@ -1016,7 +1008,11 @@
                         break;
                     case SPK.GroupControl:
                         {
-                            keyVlaue = "colorful";
+                            if (button.Name == "colorful")
+                            {
+                                keyVlaue = "colorful";
+                            }
+
                         }
                         break;
                 }
@@ -1146,7 +1142,7 @@
 
         }
 
-     
+
 
 
         /// <summary>
@@ -1158,7 +1154,8 @@
         /// <param name="button2">鏄剧ずBtn</param>
         /// <param name="button3">鏄剧ずBtn</param>
         /// <param name="button4">鏄剧ずBtn</param>
-        private void GetEditDeviceState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4)
+        /// <param name="attribute">灞炴�ey</param>
+        private void GetEditDeviceState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4, string attribute="")
         {
             Output outputs = Logic.currlogic.output[index];
             var dicList = outputs.status;
@@ -1175,7 +1172,7 @@
                 this.btnDelay.Text = outputs.delay + "s";
                 this.strdelay = outputs.delay;
             }
-            InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4);
+            InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4, attribute);
         }
         /// <summary>
         /// 娣诲姞閫変腑鏁版嵁

--
Gitblit v1.8.0