| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 添加虚拟设备到缓存
|
| | | /// </summary>
|
| | | /// <param name="device">设备对象</param>
|
| | | public void AddVirtualDeviceToMemory(CommonDevice device)
|
| | | {
|
| | | string mainKeys = this.GetDeviceMainKeys(device);
|
| | | this.dicAllDevice[mainKeys] = device;
|
| | |
|
| | | //设备回路收集
|
| | | if (this.dicDeviceEpoint.ContainsKey(device.DeviceAddr) == false)
|
| | | {
|
| | | this.dicDeviceEpoint[device.DeviceAddr] = new HashSet<int>();
|
| | | }
|
| | | if (this.dicDeviceEpoint[device.DeviceAddr].Contains(device.DeviceEpoint) == false)
|
| | | {
|
| | | this.dicDeviceEpoint[device.DeviceAddr].Add(device.DeviceEpoint);
|
| | | }
|
| | | device.ReSave();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 修改设备___________________________
|
| | |
| | | this.SetEpointName(device, newName);
|
| | |
|
| | | this.BackupDeviceAfterReName(device);
|
| | |
|
| | | //如果住宅为虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | //不再检测名字是否一样
|
| | | //成员只能修改自己本地的名字
|
| | |
| | |
|
| | | //更改名字后,刷新设备缓存
|
| | | this.BackupDeviceAfterReName(device2);
|
| | | }
|
| | | //如果住宅为虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | CommonDevice device = listDevice[0];
|
| | |
| | | /// <param name="device"></param>
|
| | | public void SetFixedPositionCommand(CommonDevice device)
|
| | | {
|
| | | device.IdentifyControl(device.DeviceAddr, device.DeviceEpoint, 5);
|
| | | //如果当前住宅不是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | device.IdentifyControl(device.DeviceAddr, device.DeviceEpoint, 5);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | info.ConcreteType = DeviceConcreteType.Sensor_Humidity;
|
| | | }
|
| | | info.ObjectTypeNameId = 60000;//传感器
|
| | | }
|
| | | //14新风设备
|
| | | else if (dicType.ContainsKey(DeviceType.FreshAir) == true)
|
| | | {
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId2310;
|
| | | info.BeloneType = DeviceBeloneType.A新风;
|
| | | info.ConcreteType = DeviceConcreteType.Relay_FangyueFreshAirModul;
|
| | | info.ObjectTypeNameId = 60011;//新风
|
| | | }
|
| | |
|
| | | int value = (int)info.BeloneType;
|
| | |
| | | /// <summary>
|
| | | /// 干接点
|
| | | /// </summary>
|
| | | A干接点 = 16
|
| | | A干接点 = 16,
|
| | | /// <summary>
|
| | | /// 新风
|
| | | /// </summary>
|
| | | A新风 = 17
|
| | | }
|
| | |
|
| | | #endregion
|