| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置【设备类型】的图标到指定的控件
|
| | | /// 设置【设备类型】的图标到指定的控件(此方法不能用在设备功能类型菜单的图标)
|
| | | /// </summary>
|
| | | /// <param name="btnIcon">控件对象</param>
|
| | | /// <param name="listdevice">设备对象</param>
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取【设备类型】的图标
|
| | | /// 获取【设备类型】的图标(此方法不能用在设备功能类型菜单的图标)
|
| | | /// </summary>
|
| | | /// <param name="listdevice">设备对象</param>
|
| | | /// <param name="unSelectPath">图片地址</param>
|
| | |
| | | }
|
| | |
|
| | | /// <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);
|
| | |
| | | unSelectPath = imageFilePath;
|
| | | selectPath = imageSelectFilePath;
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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; }
|
| | |
| | | /// </summary>
|
| | | A传感器 = 1200,
|
| | | /// <summary>
|
| | | /// PM2.5空气质量传感器
|
| | | /// </summary>
|
| | | APM2点5空气质量传感器 = 1307,
|
| | | /// <summary>
|
| | | /// 继电器(2300-2499)
|
| | | /// </summary>
|
| | | A继电器 = 2300,
|