wjc
2023-07-26 9508510f0b27da3278fa1161eb2ba3dd1e3e2030
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;
                //插座(有USB)
                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">属性key</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>
        /// 添加选中数据