陈嘉乐
2020-12-03 f1e8c2cde53050ffe78ef3b13346ba77ca65110c
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
@@ -34,6 +34,64 @@
            Radius = (uint)Application.GetRealHeight(12)
        };
        /// <summary>
        /// 开
        /// </summary>
        public 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),
        };
        /// <summary>
        /// 线
        /// </summary>
        public Button btnLine = new Button
        {
            Height = 1,
            BackgroundColor = CSS.CSS_Color.viewLine,
            Y = Application.GetRealHeight(43),
        };
        /// <summary>
        /// 关
        /// </summary>
        public Button btnOff = new Button
        {
            Y = Application.GetRealHeight(44),
            TextAlignment = TextAlignment.Center,
            TextSize = LogicView.TextSize.text16,
            TextColor = CSS.CSS_Color.textCancelColor,
            TextID = StringId.offLogic,
            Height = Application.GetRealHeight(44),
            Width = Application.GetRealWidth(343),
        };
        /// <summary>
        /// 线1
        /// </summary>
        public Button btnLine1 = new Button
        {
            Height = 1,
            BackgroundColor = CSS.CSS_Color.viewLine,
            Y = Application.GetRealHeight(43 + 44),
        };
        /// <summary>
        /// 暂停
        /// </summary>
        public Button btnStop = new Button
        {
            Y = Application.GetRealHeight(44 + 44),
            TextAlignment = TextAlignment.Center,
            TextSize = LogicView.TextSize.text16,
            TextColor = CSS.CSS_Color.textCancelColor,
            TextID = StringId.stop,
            Height = Application.GetRealHeight(44),
            Width = Application.GetRealWidth(343),
        };
        /// <summary>
        /// View的方法
        /// </summary>
        ///  <param name="frame">父控件</param>
@@ -45,6 +103,15 @@
            frameLayout.Height = Application.GetRealHeight(44 * i);
            frame.AddChidren(frameLayout);
            frame.AddChidren(btnCancel);
            frameLayout.AddChidren(btnOn);
            frameLayout.AddChidren(btnLine);
            frameLayout.AddChidren(btnOff);
            if (i > 2)
            {
                /// 判断是否要是显示"暂停"按钮
                frameLayout.AddChidren(btnLine1);
                frameLayout.AddChidren(btnStop);
            }
            btnCancel.MouseUpEventHandler += (sender1, e1) =>
            {
                frame.RemoveFromParent();