old mode 100644
new mode 100755
File was renamed from ZigbeeApp20200414/Shared/Common/Device.cs |
| | |
| | | {
|
| | | CommonDevice device = null;
|
| | | //反序列化为指定的类,不然数据会丢失而导致无法强转
|
| | | try |
| | | try |
| | | {
|
| | | device = CommonDevice.CommonDeviceByFilePath(file);
|
| | | }
|
| | |
| | | /// <param name="device">设备对象</param>
|
| | | /// <returns></returns>
|
| | | public string GetDeviceEpointName(CommonDevice device)
|
| | | { |
| | | {
|
| | | string dName = this.GetSimpleEpointName(device);
|
| | | if (string.IsNullOrEmpty(dName) == false)
|
| | | {
|
| | |
| | | if (this.GetDevicesCountByMac(device.DeviceAddr) <= 1)
|
| | | {
|
| | | return this.GetDeviceMacName(device);
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | //同一设备里面,不同类型的回路,它的命名都从1开始
|
| | | int epointNo = 0;
|
| | | var listSort = this.GetDevicesByMac(device.DeviceAddr);
|
| | | foreach (var myDevice in listSort)
|
| | | {
|
| | | if (myDevice.Type == device.Type)
|
| | | {
|
| | | //同一类型编号+1
|
| | | epointNo++;
|
| | | if (myDevice.DeviceEpoint == device.DeviceEpoint)
|
| | | {
|
| | | //已经到达它自己
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (device.Type == DeviceType.OnOffOutput
|
| | | || device.Type == DeviceType.DimmableLight || device.Type == DeviceType.ColorDimmableLight)
|
| | | {
|
| | | //继电器,掉光器都叫回路
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + epointNo;
|
| | | }
|
| | | else if (device.Type == DeviceType.Thermostat)
|
| | | { |
| | | //空调都叫室内机 |
| | | return Language.StringByID(R.MyInternationalizationString.uIndoorUnit) + device.DeviceEpoint; |
| | | if (device.Type == DeviceType.Thermostat)
|
| | | {
|
| | | //空调都叫室内机
|
| | | return Language.StringByID(R.MyInternationalizationString.uIndoorUnit) + epointNo;
|
| | | }
|
| | | else if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | //新风面板中的按键叫新风
|
| | | return Language.StringByID(R.MyInternationalizationString.FreshAir); |
| | | }
|
| | | else if (device.Type == DeviceType.TemperatureSensor)
|
| | | { |
| | | //新风面板中的Thermostat为温度传感器 |
| | | return Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | return Language.StringByID(R.MyInternationalizationString.FreshAir);
|
| | | }
|
| | | else if (device.Type == DeviceType.FreshAirHumiditySensor)
|
| | | {
|
| | | //新风面板湿度传感器
|
| | | return Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | } |
| | | |
| | | return Language.StringByID(R.MyInternationalizationString.HumiditySensor);
|
| | | }
|
| | |
|
| | | //获取设备类型
|
| | | var deviceInfoType = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | var deviceInfoType = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (device.Type == DeviceType.OnOffSwitch)
|
| | | {
|
| | | //面板的干接点叫按键
|
| | | if (deviceInfoType.BeloneType == DeviceBeloneType.A按键面板)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uPanelButton) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uPanelButton) + epointNo;
|
| | | }
|
| | | //其他的干接点叫干接点
|
| | | else
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceBelongId16) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceBelongId16) + epointNo;
|
| | | }
|
| | | } |
| | | //其他情况,使用它的默认名称 |
| | | return Language.StringByID(deviceInfoType.DefultNameId) + device.DeviceEpoint;
|
| | | }
|
| | | else if (device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | if (deviceInfoType.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | //新风面板中的Thermostat为温度传感器
|
| | | return Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
|
| | | }
|
| | | else if (deviceInfoType.BeloneType == DeviceBeloneType.A按键面板)
|
| | | {
|
| | | //面板的温度探头叫 面板名字+温度
|
| | | return Language.StringByID(deviceInfoType.DefultNameId) + Language.StringByID(R.MyInternationalizationString.uTemperature);
|
| | | }
|
| | | }
|
| | | //其他情况,使用它的默认名称
|
| | | return Language.StringByID(deviceInfoType.DefultNameId) + epointNo;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | list.Add(DeviceBeloneType.A传感器);
|
| | |
|
| | | //其他的看着办呗,都是排在后面的,都归为这个属性
|
| | | list.Add(DeviceBeloneType.A未知设备); |
| | | |
| | | list.Add(DeviceBeloneType.A未知设备);
|
| | | |
| | | return list;
|
| | | }
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 方悦新风小模块 镜像id:2310
|
| | | /// </summary>
|
| | | Relay_FangyueFreshAirModul = 2310, |
| | | |
| | | //=========★★调光器类(2500-2799)★★========= |
| | | Relay_FangyueFreshAirModul = 2310,
|
| | | |
| | | //=========★★调光器类(2500-2799)★★=========
|
| | | /// <summary>
|
| | | /// 调光器
|
| | | /// </summary>
|