| | |
| | | //在端点名字的后面附加【回路】字样
|
| | | dName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | await this.ReName(device, dName, ShowErrorMode.NO);
|
| | | this.ReName(device, dName, ShowErrorMode.NO);
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | /// <param name="device">设备对象</param>
|
| | | /// <param name="newName">新名字</param>
|
| | | /// <param name="mode">是否显示错误</param>
|
| | | public async Task<bool> ReName(CommonDevice device, string newName, ShowErrorMode mode = ShowErrorMode.YES)
|
| | | public bool ReName(CommonDevice device, string newName, ShowErrorMode mode = ShowErrorMode.YES)
|
| | | {
|
| | | //先别管那么多,更改名字后,刷新设备缓存
|
| | | this.SetEpointName(device, newName);
|
| | |
| | | //如果住宅为虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //修改设备名字的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | //成员只能修改自己本地的名字
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 3)
|
| | | {
|
| | | var result = await device.RenameDeviceNameAsync(device.DeviceAddr, device.DeviceEpoint, newName);
|
| | | var result = this.RenameDeviceNameAsync(device, newName);
|
| | | if (result == null || result.deviceRenameData == null || result.deviceRenameData.Result == 1)
|
| | | {
|
| | | //设备名称修改失败
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | //备份数据
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.A端点名称, newName);
|
| | | }
|
| | | //修改设备名字的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | /// <param name="listDevice">设备对象</param>
|
| | | /// <param name="newMacName">新名字</param>
|
| | | /// <param name="mode">是否显示错误</param>
|
| | | public async Task<bool> ReMacName(List<CommonDevice> listDevice, string newMacName, ShowErrorMode mode = ShowErrorMode.YES)
|
| | | public bool ReMacName(List<CommonDevice> listDevice, string newMacName, ShowErrorMode mode = ShowErrorMode.YES)
|
| | | {
|
| | | if (listDevice.Count == 0)
|
| | | {
|
| | |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 3)
|
| | | {
|
| | | //修改物理名字
|
| | | var result = await device.RenameDeviceMacNameAsync(device.DeviceAddr, device.DeviceEpoint, newMacName);
|
| | | var result = this.RenameDeviceMacNameAsync(device, newMacName);
|
| | | if (result == null || result.renameDeviceMacNameData == null || result.renameDeviceMacNameData.Result != 0)
|
| | | {
|
| | | //设备名称修改失败
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | //备份数据
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.AMac名称, newMacName);
|
| | | //如果它只有一个回路,则更改端点名字
|
| | | if (this.dicDeviceEpoint.ContainsKey(device.DeviceAddr) == true)
|
| | | {
|
| | | //只有一个端点
|
| | | if (this.dicDeviceEpoint[device.DeviceAddr].Count == 1)
|
| | | {
|
| | | return await this.ReName(device, newMacName);
|
| | | return this.ReName(device, newMacName);
|
| | | }
|
| | | //如果它有两个端点时,pir传感器特殊处理
|
| | | else if (this.dicDeviceEpoint[device.DeviceAddr].Count == 2)
|
| | |
| | | {
|
| | | if (myDevice.Type == DeviceType.IASZone)
|
| | | {
|
| | | return await this.ReName(myDevice, newMacName);
|
| | | return this.ReName(myDevice, newMacName);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | ///<summary >
|
| | | /// 修改设备mac名称
|
| | | /// <para>macName:设备名称</para>
|
| | | /// </summary>
|
| | | private CommonDevice.RenameDeviceMacNameAllData RenameDeviceMacNameAsync(CommonDevice device, string macName)
|
| | | {
|
| | | //如果当前是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceMacName(device, macName, "MacRename");
|
| | | }
|
| | |
|
| | | //获取编辑设备Mac名字的命令字符
|
| | | var sendData = this.GetReDeviceMacNameCommandText(device.DeviceAddr, device.DeviceEpoint, macName);
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "MacRename", sendData, "MacRename_Respon");
|
| | | if (result.ErrorMsg != null || result.ErrorMsgDiv == 0)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | //加缓存
|
| | | Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceMacName(device, macName, "MacRename");
|
| | |
|
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RenameDeviceMacNameData>(result.ReceiptData);
|
| | | return new CommonDevice.RenameDeviceMacNameAllData { renameDeviceMacNameData = tempData };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 修改设备端口(按键)名称
|
| | | /// </summary>
|
| | | /// <param name="device">设备对象</param>
|
| | | /// <param name="deviceName">设备端点名字</param>
|
| | | /// <returns></returns>
|
| | | private CommonDevice.DeviceRenameAllData RenameDeviceNameAsync(CommonDevice device, string deviceName)
|
| | | {
|
| | | //如果当前是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceEpointName(device, deviceName, "DeviceRename");
|
| | | }
|
| | | //获取编辑设备端点名字的命令字符
|
| | | var sendData = this.GetReDeviceEpointNameCommandText(device.DeviceAddr, device.DeviceEpoint, deviceName);
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "DeviceRename", sendData, "DeviceRenameRespon");
|
| | | if (result.ErrorMsg != null || result.ErrorMsgDiv == 0)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | //加缓存
|
| | | Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceEpointName(device, deviceName, "DeviceRename");
|
| | |
|
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceRenameResponseData>(result.ReceiptData);
|
| | | return new CommonDevice.DeviceRenameAllData { deviceRenameData = tempData };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取编辑设备Mac名字的命令字符
|
| | | /// </summary>
|
| | | /// <param name="deviceAddr"></param>
|
| | | /// <param name="deviceEpoint"></param>
|
| | | /// <param name="deviceName"></param>
|
| | | /// <returns></returns>
|
| | | public string GetReDeviceMacNameCommandText(string deviceAddr, int deviceEpoint, string deviceName)
|
| | | {
|
| | | var bytes = new byte[64];
|
| | | var reamarkGwBytes = Encoding.UTF8.GetBytes(deviceName);
|
| | | System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 64 < reamarkGwBytes.Length ? 64 : reamarkGwBytes.Length);
|
| | | deviceName = Encoding.UTF8.GetString(bytes);
|
| | |
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", deviceAddr }, { "Epoint", deviceEpoint }, { "Cluster_ID", 0 }, { "Command", 100 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "MacName", deviceName } };
|
| | | jObject.Add("Data", data);
|
| | | return jObject.ToString();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取编辑设备端点名字的命令字符
|
| | | /// </summary>
|
| | | /// <param name="deviceAddr"></param>
|
| | | /// <param name="deviceEpoint"></param>
|
| | | /// <param name="deviceName"></param>
|
| | | /// <returns></returns>
|
| | | public string GetReDeviceEpointNameCommandText(string deviceAddr, int deviceEpoint, string deviceName)
|
| | | {
|
| | | var bytes = new byte[64];
|
| | | var reamarkGwBytes = Encoding.UTF8.GetBytes(deviceName);
|
| | | System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 64 < reamarkGwBytes.Length ? 64 : reamarkGwBytes.Length);
|
| | | deviceName = Encoding.UTF8.GetString(bytes);
|
| | |
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", deviceAddr }, { "Epoint", deviceEpoint }, { "Cluster_ID", 0 }, { "Command", 96 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "DeviceName", deviceName } };
|
| | | jObject.Add("Data", data);
|
| | |
|
| | | return jObject.ToString();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="deleteRoom">是否从房间删除</param>
|
| | | public void DeleteMemmoryDevice(CommonDevice device, bool deleteRoom = true)
|
| | | {
|
| | | //删除缓存设备的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | |
|
| | | if (deleteRoom == true)
|
| | | {
|
| | | //从房间中删除
|
| | |
| | | /// <returns></returns>
|
| | | public bool DeviceIsCanFixedPosition(CommonDevice device)
|
| | | {
|
| | | if (device.Type == DeviceType.DoorLock)
|
| | | if (device.Type == DeviceType.DoorLock || device.Type == DeviceType.PMSensor)
|
| | | {
|
| | | //门锁没有定位功能
|
| | | return false;
|
| | |
| | | }
|
| | |
|
| | | /// <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);
|
| | |
| | | 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;
|
| | | if (dicDeviceAllNameID.ContainsKey("uDeviceBelongId" + value) == true)
|
| | |
| | | /// <param name="saveRoadDevice">如果只有一个回路,是否把回路的房间一起修改</param>
|
| | | public void SaveRealDeviceRoomId(List<CommonDevice> listDevice, string roomId, bool saveRoadDevice = true)
|
| | | {
|
| | | if (listDevice != null)
|
| | | if (listDevice == null)
|
| | | {
|
| | | if (roomId == string.Empty)
|
| | | {
|
| | | //选择的是未分配
|
| | | this.dicDeviceRoomId.Remove(listDevice[0].DeviceAddr);
|
| | | }
|
| | | else
|
| | | {
|
| | | this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId;
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | //保存记录
|
| | | string fullName = UserCenterLogic.CombinePath(DirNameResourse.DeviceRoomIdFile);
|
| | | UserCenterLogic.SaveFileContent(fullName, this.dicDeviceRoomId);
|
| | |
|
| | | //添加自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile);
|
| | |
|
| | | //如果设备只有一个回路,如果改变了真实设备区域,则它的回路的区域也一起改了
|
| | | if (saveRoadDevice == true && listDevice != null && listDevice.Count == 1)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | | HdlRoomLogic.Current.ChangedRoom(listDevice[0], roomId, false);
|
| | | }
|
| | | bool save = false;
|
| | | if (roomId == string.Empty)
|
| | | {
|
| | | //选择的是未分配
|
| | | this.dicDeviceRoomId.Remove(listDevice[0].DeviceAddr);
|
| | | save = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (this.dicDeviceRoomId.ContainsKey(listDevice[0].DeviceAddr) == false)
|
| | | {
|
| | | this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId;
|
| | | save = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | //2020.05.18追加:如果记录的房间ID是不存在的话,则重新覆盖
|
| | | var room = HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[listDevice[0].DeviceAddr]);
|
| | | if (room == null)
|
| | | {
|
| | | this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId;
|
| | | save = true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (save == true)
|
| | | {
|
| | | //保存记录
|
| | | string fullName = UserCenterLogic.CombinePath(DirNameResourse.DeviceRoomIdFile);
|
| | | UserCenterLogic.SaveFileContent(fullName, this.dicDeviceRoomId);
|
| | |
|
| | | //添加自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | //添加自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 根据房间ID,移除指定的真实物理设备的所属房间记录
|
| | | /// </summary>
|
| | | /// <param name="i_RoomId"></param>
|
| | | public void DeleteRealDeviceByRoomId(string i_RoomId)
|
| | | {
|
| | | var listDeleteKey = new List<string>();
|
| | | foreach (var deviceAddr in this.dicDeviceRoomId.Keys)
|
| | | {
|
| | | if (this.dicDeviceRoomId[deviceAddr] == i_RoomId
|
| | | && listDeleteKey.Contains(deviceAddr) == false)
|
| | | {
|
| | | listDeleteKey.Add(deviceAddr);
|
| | | }
|
| | | }
|
| | | //将真实物理设备从房间中移除
|
| | | this.DeleteRealDeviceFromRoom(listDeleteKey);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | |
|
| | | #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
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <returns></returns>
|
| | | public bool CheckDeviceIsOnline(CommonDevice i_device)
|
| | | {
|
| | | //0:离线 1:在线 2:正在刷新状态 |
| | | return i_device.IsOnline == 1 || i_device.IsOnline == 2;
|
| | | var listDevice = this.GetDevicesByMac(i_device.DeviceAddr, false);
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | //0:离线 1:在线 2:正在刷新状态 |
| | | bool statu = i_device.IsOnline == 1 || i_device.IsOnline == 2;
|
| | | if (statu == true)
|
| | | {
|
| | | //有一个回路在线,即在线
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | if (listCheck.Contains(mainkeys) == false)
|
| | | {
|
| | | listDevice.Add(device);
|
| | |
|
| | | listCheck.Add(mainkeys);
|
| | | //刷新一下本地缓存
|
| | | var localDevice = this.GetDevice(mainkeys);
|
| | | if (localDevice != null)
|
| | | {
|
| | | //刷新属性
|
| | | this.SetDeviceInfoToMain(localDevice, device);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | 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;
|
| | |
| | | mainDevice.InClusterList.AddRange(device.DeviceInfo.InClusterList);
|
| | | mainDevice.OutClusterList.Clear();
|
| | | mainDevice.OutClusterList.AddRange(device.DeviceInfo.OutClusterList);
|
| | | mainDevice.AttributeStatus.Clear();
|
| | | mainDevice.AttributeStatus.AddRange(device.DeviceInfo.AttributeStatus);
|
| | |
|
| | | //如果是温度传感器
|
| | | if (mainDevice.Type == DeviceType.TemperatureSensor)
|
| | |
| | | //如果是三路继电器的回路的话,默认为灯光
|
| | | else if (mainDevice.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | var myType = this.GetHdlMyDeviceEnumInfo(mainDevice);
|
| | | if (myType != null && myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad)
|
| | | //2020.05.13变更:继电器都默认为灯光
|
| | | //var myType = this.GetHdlMyDeviceEnumInfo(mainDevice);
|
| | | //if (myType != null && myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad)
|
| | | {
|
| | | if (mainDevice.DfunctionType == DeviceFunctionType.A未定义)
|
| | | {
|
| | |
| | | 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; }
|
| | |
| | | public void SetNewDeviceMainKeys(CommonDevice device, Newtonsoft.Json.Linq.JObject jobject)
|
| | | {
|
| | | //设置设备主键类
|
| | | device.Time = jobject.Value<int>("Time");
|
| | | device.DeviceID = jobject.Value<int>("Device_ID");
|
| | | device.DeviceAddr = jobject.Value<string>("DeviceAddr");
|
| | | device.DeviceEpoint = jobject.Value<int>("Epoint");
|
| | | device.DataID = jobject.Value<int>("Data_ID");
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1200-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1200-60000";//紧急按键
|
| | | this.dicDeviceModelIdEnum["MGCD01/ZB.10"] = "1306-1200-60000";//吸顶燃气传感器
|
| | |
|
| | | //PM2.5空气质量传感器 【该设备属于第三方设备,没有镜像ID】
|
| | | this.dicDeviceModelIdEnum["SZ_PM100"] = "1307-1200-60000";//PM2.5空气质量传感器 |
| | |
|
| | | //=========★★继电器类(2300-2499)★★=========
|
| | | this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3路继电器小模块
|
| | |
| | | /// </summary>
|
| | | Sensor_CeilingGas = 1306,
|
| | | /// <summary>
|
| | | /// PM2.5空气质量传感器
|
| | | /// </summary>
|
| | | Sensor_PMTwoPointFive = 1307,
|
| | |
|
| | | /// <summary>
|
| | | /// 运动传感器
|
| | | /// </summary>
|
| | | Sensor_Motion = -1306,
|
| | |
| | | /// </summary>
|
| | | A传感器 = 1200,
|
| | | /// <summary>
|
| | | /// PM2.5空气质量传感器
|
| | | /// </summary>
|
| | | APM2点5空气质量传感器 = 1307,
|
| | | /// <summary>
|
| | | /// 继电器(2300-2499)
|
| | | /// </summary>
|
| | | A继电器 = 2300,
|