陈嘉乐
2020-12-03 f1e8c2cde53050ffe78ef3b13346ba77ca65110c
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -77,11 +77,11 @@
                    }
                    break;
            }
            #region  保存
            ///保存View
@@ -262,43 +262,12 @@
            LogicView.SwitchView switchView = new LogicView.SwitchView();
            switchView.FLayoutView(frame, len);
            Button btnOn = new Button
            {
                TextAlignment = TextAlignment.Center,
                TextSize = LogicView.TextSize.text16,
                TextColor = CSS.CSS_Color.textCancelColor,
                TextID = StringId.onLogic,
                Height = Application.GetRealHeight(44),
                Width = Application.GetRealWidth(343),
            };
            switchView.frameLayout.AddChidren(btnOn);
            Button btnLine = new Button
            {
                Height = 1,
                BackgroundColor = CSS.CSS_Color.viewLine,
                Y = btnOn.Bottom,
            };
            switchView.frameLayout.AddChidren(btnLine);
            Button btnOff = new Button
            {
                Y = btnLine.Bottom,
                TextAlignment = TextAlignment.Center,
                TextSize = LogicView.TextSize.text16,
                TextColor = CSS.CSS_Color.textCancelColor,
                TextID = StringId.offLogic,
                Height = Application.GetRealHeight(44),
                Width = Application.GetRealWidth(343),
            };
            switchView.frameLayout.AddChidren(btnOff);
            Dictionary<string, string> dic = new Dictionary<string, string>();
            LogicMethod.dictionary(dic, "key", "on_off");
            LogicMethod.dictionary(dic, "comparator", "=");
            LogicMethod.dictionary(dic, "data_type", "string");
            keyVlaue = "on_off";
            btnOn.MouseUpEventHandler += (sender2, e2) =>
            switchView.btnOn.MouseUpEventHandler += (sender2, e2) =>
            {
                LogicMethod.dictionary(dic, "value", "on");
                RemView(frame);
@@ -306,7 +275,7 @@
                selectedState = device.functionType + "_on";
                AddDictionaryData(dicSateteList, keyVlaue, dic);
            };
            btnOff.MouseUpEventHandler += (sender3, e3) =>
            switchView.btnOff.MouseUpEventHandler += (sender3, e3) =>
            {
                LogicMethod.dictionary(dic, "value", "off");
                RemView(frame);
@@ -316,13 +285,13 @@
            };
            if (button.Text != "")
            {
                if (button.Text == btnOn.Text)
                if (button.Text == switchView.btnOn.Text)
                {
                    btnOn.TextColor = CSS.CSS_Color.textConfirmColor;
                    switchView.btnOn.TextColor = CSS.CSS_Color.textConfirmColor;
                }
                else
                else if (button.Text == switchView.btnOff.Text)
                {
                    btnOff.TextColor = CSS.CSS_Color.textConfirmColor;
                    switchView.btnOff.TextColor = CSS.CSS_Color.textConfirmColor;
                }
            }
        }