wjc
2022-06-13 32ad85a377b00bc54ad7f15a45d7631d3e2b10d5
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -24,10 +24,20 @@
        /// 定义一个变量,记录选中状态
        /// </summary>
        private string selectedState = "unknown";
        /// <summary>
        /// 是不是再次编辑
        /// </summary>
        private bool mEdit;
        /// <summary>
        /// 输入条件列表索引值
        /// </summary>
        private int mIndex;
        public void Show(Entity.Function device, int index, bool edit)
        {
            this.function = device;
            this.mEdit = edit;
            this.mIndex = index;
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            LogicView.TopView topView = new LogicView.TopView();
@@ -217,8 +227,36 @@
                        }
                    }
                    break;
                //毫米波传感器
                //毫米波传感器(自研北邮)
                case SPK.SenesorMegahealth:
                    {
                        LogicView.FunTypeView view1= new LogicView.FunTypeView();
                        view1.btnText.TextID = StringId.diedaobaojing;
                        view1.btnState.Name = Language.StringByID(StringId.diedaobaojing);
                        fLayout.AddChidren(view1.FLayoutView());
                        view1.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1);
                        };
                        LogicView.FunTypeView view2 = new LogicView.FunTypeView();
                        view2.frameLayout.Y = view1.frameLayout.Bottom;
                        view2.btnText.TextID = StringId.yourenbaojing;
                        view2.btnState.Name = Language.StringByID(StringId.yourenbaojing);
                        fLayout.AddChidren(view2.FLayoutView());
                        view2.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            DeviceView(device, view2.btnState, StringId.shi, StringId.offLogic, 1);
                        };
                        if (edit)
                        {
                            GetEditState(device, index, view1.btnState, view2.btnState, null, null);
                        }
                    }
                    break;
                //毫米波传感器(兆观专用云云对接)
                case SPK.SenesorMegahealth2:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -550,6 +588,23 @@
                        }
                        break;
                    case SPK.SenesorMegahealth:
                        {
                            if (button != null)
                            {
                                if (button.Name == Language.StringByID(StringId.yourenbaojing))
                                {
                                    keyVlaue = "people_status";
                                }
                                else
                                {
                                    keyVlaue = "target_status";
                                }
                            }
                        }
                        break;
                    case SPK.SenesorMegahealth2:
                        {
                            keyVlaue = "action_state";
@@ -608,6 +663,25 @@
                        }
                        break;
                    case StringId.shi:
                        {
                            value = "open";
                            if (button != null)
                            {
                                if (button.Name == Language.StringByID(StringId.yourenbaojing))
                                {
                                    //状态(有人)
                                    value = "true";
                                }
                                else if(button.Name == Language.StringByID(StringId.diedaobaojing))
                                {
                                    //跌倒
                                    value = "4";
                                }
                            }
                        }
                        break;
                    case StringId.kaiqi:
                        {
                            value = "open";
@@ -639,6 +713,17 @@
                button.TextID = intValue;
                selectedState = device.spk + "_" + value;
                AddDictionary(keyVlaue, value, "string");
                if (button != null)
                {
                    if (button.Name == Language.StringByID(StringId.yourenbaojing)
                    || (button.Name == Language.StringByID(StringId.diedaobaojing)))
                    {
                        //只有毫米波传感器(自研)
                        Save(device, mIndex, mEdit);
                    }
                }
            });