wjc
2023-03-28 a9d1161b1df96e7ddad566335989a1444e433ef5
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -30,7 +30,7 @@
            VerticalScrolViewLayout vv = new VerticalScrolViewLayout
            {
                Y = funAllAreaView.frameLayout.Bottom,
                Height = Application.GetRealHeight(667 - 64 - 50 * funCount - 8),
                Height = Application.GetRealHeight(667 - 64 - 50 * funCount - 8-50),
            };
            viewLayout.AddChidren(vv);
            if (!MainView.IsGatewayType)
@@ -77,7 +77,7 @@
                    Width = Application.GetRealWidth(144),
                    Height = Application.GetRealHeight(44 * 5),
                };
                var roomList = LogicMethod.CurrLogicMethod.GetGatewayRoomList(Language.StringByID(StringId.allAreas));
                var roomList = LogicMethod.Current.GetGatewayRoomList(Language.StringByID(StringId.allAreas));
                if (roomList.Count > 5)
                {
@@ -121,7 +121,7 @@
                        ///切换房间默认:全部功能
                        UserInfo.Current.logicselectedFunction = Language.StringByID(StringId.allFun);
                        ///获取显示设备列表
                        var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_Type);
                        var list = LogicMethod.Current.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_Type);
                        this.LoadingDeviceListView(vv, list);
                    };
@@ -139,9 +139,9 @@
            {
                //获取最终显示列表
                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
                var functionList = LogicMethod.Current.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
                //获取设备列表的类型(例如:灯光类,窗帘类。。。)
                var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList);
                var deviceTypeList = LogicMethod.Current.GetDeviceTypeList(functionList);
                if (deviceTypeList.Count == 0)
                {
                    //没有类型直接返回去;
@@ -223,9 +223,9 @@
                        funAllAreaView.btnText2.Text = clickText;
                        UserInfo.Current.logicselectedFunction = clickText;
                        ///获取设备单个大类spk列表(例如:灯光类,空调类...)
                        var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(clickText);
                        var typeFunctionList2 = LogicMethod.Current.GetDeviceTypeFunctionList(clickText);
                        ///获取设备单个小类列表(例如:灯光1,灯光2...)
                        var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList2, functionList);
                        var lists2 = LogicMethod.Current.GetShowDeviceList(typeFunctionList2, functionList);
                       this.LoadingDeviceListView(vv, lists2);
                    };
@@ -239,20 +239,26 @@
            funAllAreaView.btnText2.MouseUpEventHandler += funClick;
            funAllAreaView.btnIcon2.MouseUpEventHandler += funClick;
            ///获取房间支持的设备列表
            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
            var deviceList = LogicMethod.Current.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
            ///获取设备单个大类spk列表(例如:灯光类,空调类...)
            var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
            var typeFunctionList = LogicMethod.Current.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
            ///获取设备单个小类列表(例如:灯光1,灯光2...)
            var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, deviceList);
            var lists = LogicMethod.Current.GetShowDeviceList(typeFunctionList, deviceList);
            if (string.IsNullOrEmpty(UserInfo.Current.logicselectedRoom.roomName))
            {
                UserInfo.Current.logicselectedRoom.roomName = Language.StringByID(StringId.allAreas);
            }
            ///房间名称
            funAllAreaView.btnText1.Text = UserInfo.Current.logicselectedRoom.roomName;
            if (string.IsNullOrEmpty(UserInfo.Current.logicselectedFunction))
            {
                UserInfo.Current.logicselectedFunction = Language.StringByID(StringId.allFun);
            }
            ///设备大类名称<灯光类。。。。。>
            funAllAreaView.btnText2.Text = UserInfo.Current.logicselectedFunction;
            this.LoadingDeviceListView(vv, lists);
        }
        /// <summary>
        /// 显示设备的View
        /// </summary>
@@ -260,6 +266,7 @@
        /// <param name="deviceList"></param>
        private void LoadingDeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
        {
            loading.Start();
            System.Threading.Tasks.Task.Run(() =>
            {
@@ -276,9 +283,10 @@
                        funView.btnLine.X = Application.GetRealWidth(16);
                        funView.btnLine.Width = Application.GetRealWidth(343);
                        verticalScrolView.AddChidren(funView.FLayoutView());
                        funView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(dev.spk);
                        funView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(dev);
                        funView.btnDeviceName.Text = dev.name;
                        funView.btnRoomName.Text = dev.GetRoomListName();
                        funView.btnClick.MouseUpEventHandler += (sen, e) =>
                        {
                            if (if_Type == LogicMethod.condition_if)