| | |
| | |
|
| | | //获取编辑设备Mac名字的命令字符
|
| | | var sendData = this.GetReDeviceMacNameCommandText(device.DeviceAddr, device.DeviceEpoint, macName);
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "MacRename", sendData, "MacRename_Respon");
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "MacRename", sendData, "MacRename_Respon", 8);
|
| | | if (result.ErrorMsg != null || result.ErrorMsgDiv == 0)
|
| | | {
|
| | | return null;
|
| | |
| | | }
|
| | | //获取编辑设备端点名字的命令字符
|
| | | var sendData = this.GetReDeviceEpointNameCommandText(device.DeviceAddr, device.DeviceEpoint, deviceName);
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "DeviceRename", sendData, "DeviceRenameRespon");
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "DeviceRename", sendData, "DeviceRenameRespon", 8);
|
| | | if (result.ErrorMsg != null || result.ErrorMsgDiv == 0)
|
| | | {
|
| | | return null;
|
| | |
| | | info.ConcreteType = DeviceConcreteType.Sensor_DoorWindow;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId1301;
|
| | | }
|
| | | else if (iasZone.IasDeviceType == 541)
|
| | | {
|
| | | //球型移动传感器
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_SphericalMotion;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId1205;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | list.Add(DeviceBeloneType.A未知设备);
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 获取设备在线状态列表_______________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取设备在线状态列表(注意,一个设备只返回一个回路)
|
| | | /// </summary>
|
| | | /// <param name="gwId">网关id</param>
|
| | | /// <returns></returns>
|
| | | public List<CommonDevice> GetDeviceOnlineList(string gwId)
|
| | | {
|
| | | var zbway = HdlGatewayLogic.Current.GetLocalGateway(gwId);
|
| | | int statu = 0;
|
| | | var listDevice = this.GetDeviceListFromGateway(zbway, ref statu, false, ShowErrorMode.NO);
|
| | | if (statu == -1)
|
| | | {
|
| | | //当出现异常时,使用后备操作,直接获取本地的设备列表
|
| | | listDevice = this.GetDeviceByGatewayID(gwId);
|
| | | }
|
| | |
|
| | | var listCheck = new HashSet<string>();
|
| | | var listReturn = new List<CommonDevice>();
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | if (listCheck.Contains(device.DeviceAddr) == false)
|
| | | {
|
| | | listCheck.Add(device.DeviceAddr);
|
| | | listReturn.Add(device);
|
| | | }
|
| | | }
|
| | | return listReturn;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | mainDevice.ModelIdentifier = device.DeviceInfo.ModelIdentifier;
|
| | | //序列号
|
| | | mainDevice.SerialNumber = device.DeviceInfo.ProductCode;
|
| | | //设备功能类型
|
| | | mainDevice.DfunctionType = (DeviceFunctionType)device.DeviceInfo.FunctionType;
|
| | |
|
| | | mainDevice.InClusterList.Clear();
|
| | | mainDevice.InClusterList.AddRange(device.DeviceInfo.InClusterList);
|
| | |
| | | else if (mainDevice.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (device.DeviceInfo.FunctionType != (int)DeviceFunctionType.A灯光)
|
| | | {
|
| | | //调光器固定灯光
|
| | | this.SendDeviceFunctionTypeToGateway(mainDevice, DeviceFunctionType.A灯光);
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/Light.png";
|
| | |
| | | else if (mainDevice.Type == DeviceType.ColorTemperatureLight)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (device.DeviceInfo.FunctionType != (int)DeviceFunctionType.A灯光)
|
| | | {
|
| | | //色温灯固定灯光
|
| | | this.SendDeviceFunctionTypeToGateway(mainDevice, DeviceFunctionType.A灯光);
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/ColorLightTemperature.png";
|
| | |
| | | if (mainDevice.DfunctionType == DeviceFunctionType.A未定义)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (device.DeviceInfo.FunctionType != (int)DeviceFunctionType.A灯光)
|
| | | {
|
| | | //继电器默认为灯光
|
| | | this.SendDeviceFunctionTypeToGateway(mainDevice, DeviceFunctionType.A灯光);
|
| | | }
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | |
| | | if (mainDevice.DfunctionType == DeviceFunctionType.A未定义)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A开关;
|
| | | if (device.DeviceInfo.FunctionType != (int)DeviceFunctionType.A开关)
|
| | | {
|
| | | //空气开关默认为开关
|
| | | this.SendDeviceFunctionTypeToGateway(mainDevice, DeviceFunctionType.A开关);
|
| | | }
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | |
| | | else if (mainDevice.Type == DeviceType.ColorDimmableLight)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (device.DeviceInfo.FunctionType != (int)DeviceFunctionType.A灯光)
|
| | | {
|
| | | //彩灯默认为开关
|
| | | this.SendDeviceFunctionTypeToGateway(mainDevice, DeviceFunctionType.A灯光);
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/ColorLight.png";
|
| | |
| | |
|
| | | //=========★★PIR传感器类(1200-1299)★★=========
|
| | | this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200-60000";//pir传感器220
|
| | | this.dicDeviceModelIdEnum["MSPIRB-ZB.10"] = "1205-1200-60000";//球型移动传感器
|
| | |
|
| | | //=========★★安防类传感器类(1300-2299)★★=========
|
| | | //这里是麦乐克的
|
| | |
| | | /// pir传感器220 镜像id:1200
|
| | | /// </summary>
|
| | | Sensor_Pir = 1200,
|
| | | /// <summary>
|
| | | /// 球形移动传感器 镜像id:1205
|
| | | /// </summary>
|
| | | Sensor_SphericalMotion = 1205,
|
| | |
|
| | | //=========★★安防类传感器类(1300-2299)★★=========
|
| | | /// <summary>
|