HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-05-13 2be70a32d2a8c517bd9868fb60913fcc843e66fe
ZigbeeApp/Shared/Common/Device.cs
@@ -1331,7 +1331,7 @@
        }
        /// <summary>
        /// 设置【设备类型】的图标到指定的控件
        /// 设置【设备类型】的图标到指定的控件(此方法不能用在设备功能类型菜单的图标)
        /// </summary>
        /// <param name="btnIcon">控件对象</param>
        /// <param name="listdevice">设备对象</param>
@@ -1353,7 +1353,7 @@
        }
        /// <summary>
        /// 获取【设备类型】的图标
        /// 获取【设备类型】的图标(此方法不能用在设备功能类型菜单的图标)
        /// </summary>
        /// <param name="listdevice">设备对象</param>
        /// <param name="unSelectPath">图片地址</param>
@@ -1369,13 +1369,42 @@
        }
        /// <summary>
        /// 获取【设备类型】的图标
        /// 获取【设备功能类型】的菜单图标
        /// </summary>
        /// <param name="specificType">自定义设备类型</param>
        /// <param name="unSelectPath">图片地址</param>
        /// <param name="selectPath">图片地址</param>
        /// <returns></returns>
        public void GetDeviceObjectIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath)
        public void GetDeviceFunctionTypeMenuIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath)
        {
            //新风小模块
            if (specificType == DeviceConcreteType.Relay_FangyueFreshAirModul)
            {
                unSelectPath = "Device/FreshAirEpoint.png";
                selectPath = "Device/FreshAirEpointSelected.png";
                return;
            }
            //PM2.5空气质量传感器
            else if (specificType == DeviceConcreteType.Sensor_PMTwoPointFive)
            {
                unSelectPath = "Device/AirQualitySensorEpoint.png";
                selectPath = "Device/AirQualitySensorEpointSelected.png";
                return;
            }
            //上面需要特殊处理
            //获取【设备类型】的图标
            this.GetDeviceObjectIcon(specificType, ref unSelectPath, ref selectPath);
        }
        /// <summary>
        /// 获取【设备类型】的图标 2020.05.13:次函数不再公开
        /// </summary>
        /// <param name="specificType">自定义设备类型</param>
        /// <param name="unSelectPath">图片地址</param>
        /// <param name="selectPath">图片地址</param>
        /// <returns></returns>
        private void GetDeviceObjectIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath)
        {
            //将具体类型转字符串
            string strSpecific = Enum.GetName(typeof(DeviceConcreteType), specificType);
@@ -1412,6 +1441,7 @@
            unSelectPath = imageFilePath;
            selectPath = imageSelectFilePath;
        }
        #endregion
@@ -1817,6 +1847,14 @@
                info.BeloneType = DeviceBeloneType.A新风;
                info.ConcreteType = DeviceConcreteType.Relay_FangyueFreshAirModul;
                info.ObjectTypeNameId = 60011;//新风
            }
            //15 PM2.5传感器设备
            else if (dicType.ContainsKey(DeviceType.PMSensor) == true)
            {
                info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId1307;
                info.BeloneType = DeviceBeloneType.APM2点5空气质量传感器;
                info.ConcreteType = DeviceConcreteType.Sensor_PMTwoPointFive;
                info.ObjectTypeNameId = 60000;//传感器
            }
            int value = (int)info.BeloneType;
@@ -2505,6 +2543,7 @@
                mainDevice.DeviceEpointName = device.DeviceInfo.DeviceName;
            }
            mainDevice.CurrentGateWayId = device.CurrentGateWayId;
            mainDevice.ZigbeeType = device.DeviceInfo.ZigbeeType;
            mainDevice.IsOnline = device.DeviceInfo.IsOnline;
            mainDevice.DriveCode = device.DeviceInfo.DriveCode;
            mainDevice.IasDeviceType = device.DeviceInfo.DeviceType;
@@ -2616,6 +2655,7 @@
            else if (deviceType == DeviceType.FreshAir) { device = new FreshAir(); }
            else if (deviceType == DeviceType.DoorLock) { device = new DoorLock(); }
            else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); }
            else if (deviceType == DeviceType.PMSensor) { device = new PMSensor(); }
            else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); }
            else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); }
            else { return null; }
@@ -3069,6 +3109,10 @@
        /// </summary>
        A传感器 = 1200,
        /// <summary>
        /// PM2.5空气质量传感器
        /// </summary>
        APM2点5空气质量传感器 = 1307,
        /// <summary>
        /// 继电器(2300-2499)
        /// </summary>
        A继电器 = 2300,