黄学彪
2020-09-18 c7df85937f73fb347ee0b19e9c052d2d00a6df6c
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs
@@ -106,10 +106,10 @@
            house.IsVirtually = true;
            house.Save(false);
            Config.Instance.HomeId = house.Id;
            Config.Instance.Home = House.GetHouseByHouseId(house.Id);
            Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(house.Id);
            //预创建个人中心全部的文件夹
            UserCenterLogic.CreatAllUserCenterDirectory();
            HdlFileLogic.Current.CreatAllUserCenterDirectory();
        }
        #endregion
@@ -168,8 +168,6 @@
            var listFloorKey = this.GetAllFloorKeys();
            var dicRoomName = this.GetRoomSampleList();
            //设置初始楼层
            Config.Instance.Home.CurrentFloorId = listFloorKey[0];
            foreach (string floorKey in listFloorKey)
            {
                foreach (string roomId in dicRoomName.Keys)
@@ -224,6 +222,7 @@
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A3按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 2 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A空调网关, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                //list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A国标3路10A继电器小模块, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                //阳台
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A220pir传感器, RoomId = floorKey + "_YangTai", DeviceCount = 1 });
@@ -716,8 +715,8 @@
                    this.SetBaseDataToDevice(device, 2300, 2300, "MPD0101-ZB.10", i_RoomId);
                }
                //1个继电器
                var device2 = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 8 };
                //1个调光器
                var device2 = new DimmableLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 8 };
                device2.DfunctionType = DeviceFunctionType.A灯光;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device2, 2300, 2300, "MPD0101-ZB.10", i_RoomId);
@@ -730,6 +729,11 @@
        public void Zigbee空调网关(int i_DeviceCount, string i_RoomId)
        {
            var device2 = new OTADevice() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 200 };
            //设置设备的基本信息
            this.SetBaseDataToDevice(device2, 3600, 3600, "MAC/GW-ZB.10", i_RoomId);
            this.DeviceNumber++;
            return;
            for (int i = 0; i < i_DeviceCount; i++)
            {
                //10个空调应该可以了
@@ -896,6 +900,31 @@
            }
        }
        public void Zigbee国标3路10A继电器小模块(int i_DeviceCount, string i_RoomId)
        {
            for (int i = 0; i < i_DeviceCount; i++)
            {
                //4个干接点
                for (int j = 1; j <= 4; j++)
                {
                    var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j };
                    //设置设备的基本信息
                    this.SetBaseDataToDevice(device, 2000, 2000, "MLR0310-ZB.20", i_RoomId);
                }
                //3个继电器
                for (int j = 5; j <= 7; j++)
                {
                    var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j };
                    device.DfunctionType = DeviceFunctionType.A灯光;
                    //设置设备的基本信息
                    this.SetBaseDataToDevice(device, 2000, 2000, "MLR0310-ZB.20", i_RoomId);
                    device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 4);
                }
                this.DeviceNumber++;
            }
        }
        /// <summary>
        /// 设置设备的基本信息
        /// </summary>
@@ -914,10 +943,24 @@
            device.ModelIdentifier = ModelIdentifier;
            device.CurrentGateWayId = string.Empty;
            //默认每个设备都可以定位
            //默认每个设备都可以定位,拥有开关功能
            device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 3 });
            device.OutClusterList.Add(new CommonDevice.OutClusterObj { OutCluster = 3 });
            if (device.Type == DeviceType.AirSwitch || device.Type == DeviceType.OnOffOutput
                || device.Type == DeviceType.DimmableLight || device.Type == DeviceType.ColorDimmableLight)
            {
                device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 6 });
                device.OutClusterList.Add(new CommonDevice.OutClusterObj { OutCluster = 6 });
            }
            if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.DimmableLight
                || device.Type == DeviceType.ColorDimmableLight)
            {
                device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 8 });
            }
            if (device.Type == DeviceType.WindowCoveringDevice)
            {
                device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 258 });
            }
            //添加虚拟设备
            LocalDevice.Current.AddVirtualDeviceToMemory(device);
@@ -964,6 +1007,7 @@
            A方悦新风面板 = 25,
            A方悦新风小模块 = 26,
            A吸顶燃气传感器 = 27,
            A国标3路10A继电器小模块 = 28,
        }
        #endregion