lss
2022-05-17 ae86b09b30621e1a8512c6bcdd7e22e9c67a5402
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -12,15 +12,6 @@
            if_type = str;
        }
        /// <summary>
        /// 默认选中是房间时:全部区域
        /// </summary>
        public static Entity.Room selectedRoom = new Entity.Room { roomId ="6688" };
        /// <summary>
        /// 默认选中是设备类型时:全部功能
        /// </summary>
        //public static Entity.Room selectedRoom = new Entity.Room { roomId = "6688" };
        /// <summary>
        /// 表示是(条件/目标)
        /// </summary>
        private string if_type;
@@ -43,7 +34,9 @@
            viewLayout.AddChidren(vv);
            if (!MainView.IsGatewayType)
            {
                //如果是bus网关重置高度;
                funAllAreaView.frameLayout.Y = Application.GetRealHeight(0);
                vv.Y = funAllAreaView.frameLayout.Bottom;
            }
            //房间点击事件
            EventHandler<MouseEventArgs> roomClick = (sender, e) =>
@@ -122,7 +115,10 @@
                        funAllAreaView.btnText1.Text = (areaView.btnClick.Tag as Entity.Room).roomName;
                        ///切换房间默认功能类型全部;
                        funAllAreaView.btnText2.Text = Language.StringByID(StringId.allFun);
                        selectedRoom = (areaView.btnClick.Tag as Entity.Room);
                        //selectedRoom = (areaView.btnClick.Tag as Entity.Room);
                        UserInfo.Current.logicselectedRoom = (areaView.btnClick.Tag as Entity.Room);
                        ///切换房间默认:全部功能
                        UserInfo.Current.logicselectedFunction = Language.StringByID(StringId.allFun);
                        ///获取显示设备列表
                        var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_type);
@@ -137,12 +133,12 @@
            };
            funAllAreaView.btnText1.MouseUpEventHandler += roomClick;
            funAllAreaView.btnIcon1.MouseUpEventHandler += roomClick;
            //功能点击事件
            //功能类型点击事件
            EventHandler<MouseEventArgs> funClick = (sender3, e3) =>
            {
                //获取最终显示列表
                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type);
                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
                //获取设备列表的类型(例如:灯光类,窗帘类。。。)
                var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList);
                if (deviceTypeList.Count == 0)
@@ -223,11 +219,13 @@
                    {
                        fLayout.RemoveFromParent();
                        funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString();
                        ///获取单个类型(例如:灯光类。。)设备FunctionType列表
                        var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(areaView.btnClick.Tag.ToString());
                        ///获取单个灯光类型(例如:灯光1,灯光2。。)显示设备列表
                        var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, functionList);
                        DeviceListView(vv, lists);
                        UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString();
                        ///获取单个类型(例如:灯光类。。)设备FunctionType列表<简称:spk列表>
                        var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
                        ///获取单个灯光类型(例如:灯光1,灯光2。。)设备列表
                        var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList2, functionList);
                        DeviceListView(vv, lists2);
                    };
                    if (deviceTypeList.Count - 1 == i)
                    {
@@ -238,10 +236,17 @@
            };
            funAllAreaView.btnText2.MouseUpEventHandler += funClick;
            funAllAreaView.btnIcon2.MouseUpEventHandler += funClick;
            ///获取显示设备列表
            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type);
            DeviceListView(vv, deviceList);
            ///获取房间支持的设备列表
            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
            ///获取单个类型(例如:灯光类。。)设备FunctionType列表<简称:spk列表>
            var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
            ///获取单个灯光类型(例如:灯光1,灯光2。。)设备列表
            var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, deviceList);
            ///房间名称
            funAllAreaView.btnText1.Text = UserInfo.Current.logicselectedRoom.roomName;
            ///功能类型名称<灯光类。。。。。>
            funAllAreaView.btnText2.Text = UserInfo.Current.logicselectedFunction;
            DeviceListView(vv, lists);
        }
@@ -252,6 +257,7 @@
        /// <param name="deviceList"></param>
        public void DeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
        {
            verticalScrolView.RemoveAll();
            foreach (var dev in deviceList)
            {