old mode 100644
new mode 100755
| | |
| | | {
|
| | | CommonDevice device = null;
|
| | | //反序列化为指定的类,不然数据会丢失而导致无法强转
|
| | | try |
| | | try |
| | | {
|
| | | device = CommonDevice.CommonDeviceByFilePath(file);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <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新风设备 |
| | | }
|
| | | //14新风设备
|
| | | else if (dicType.ContainsKey(DeviceType.FreshAir) == true)
|
| | | {
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId2310;
|
| | |
| | | list.Add(DeviceBeloneType.A插座);
|
| | | list.Add(DeviceBeloneType.A调光器);
|
| | | list.Add(DeviceBeloneType.A窗帘);
|
| | | list.Add(DeviceBeloneType.A新风);
|
| | | list.Add(DeviceBeloneType.A空调);
|
| | | list.Add(DeviceBeloneType.A继电器);
|
| | | list.Add(DeviceBeloneType.A干接点);
|
| | | list.Add(DeviceBeloneType.A智能门锁);
|
| | | list.Add(DeviceBeloneType.A智能空开);
|
| | | list.Add(DeviceBeloneType.A传感器); |
| | | //其他的看着办呗,都是排在后面的,都归为这个属性 |
| | | list.Add(DeviceBeloneType.A未知设备); |
| | | |
| | | list.Add(DeviceBeloneType.A传感器);
|
| | |
|
| | | //其他的看着办呗,都是排在后面的,都归为这个属性
|
| | | list.Add(DeviceBeloneType.A未知设备);
|
| | | |
| | | return list;
|
| | | }
|
| | |
|
| | |
| | | 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.FreshAirHumiditySensor)
|
| | | {
|
| | | device = new HumiditySensor();
|
| | | }
|
| | | else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); }
|
| | | else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); }
|
| | | else { return null; }
|
| | |
|
| | |
| | | this.dicDeviceModelIdChanged["MULTI-FIRE--EA05"] = "MSS01/M-ZB.10";//烟雾传感器
|
| | | this.dicDeviceModelIdChanged["MULTI-MOTI--EA04"] = "MSPIR01/M-ZB.10";//红外传感器
|
| | | this.dicDeviceModelIdChanged["MULTI-WATE--EA02"] = "MSW01/M-ZB.10";//水浸传感器
|
| | | this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//紧急按键 |
| | | |
| | | |
| | | //✩✩✩✩✩需要共有的图片对象✩✩✩✩✩ |
| | | //两者都是DeviceConcreteType |
| | | //Keys:指定的设备 value:沿用的图片是哪款设备的 |
| | | this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//紧急按键
|
| | |
|
| | |
|
| | |
|
| | | //✩✩✩✩✩需要共有的图片对象✩✩✩✩✩
|
| | | //两者都是DeviceConcreteType
|
| | | //Keys:指定的设备 value:沿用的图片是哪款设备的
|
| | | this.dicPictrueShard = new Dictionary<string, string>();
|
| | | this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//简约4按键面板 沿用 4按键的图标
|
| | | this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//简约3按键面板 沿用 3按键的图标
|
| | |
| | | /// </summary>
|
| | | Sensor_Humidity = -1310,
|
| | |
|
| | | /// <summary>
|
| | | /// PM2.5传感器
|
| | | /// </summary>
|
| | | Sensor_PM = -1311,
|
| | |
|
| | | //=========★★继电器类(2300-2499)★★=========
|
| | | /// <summary>
|
| | | /// 继电器
|
| | |
| | | /// <summary>
|
| | | /// 方悦新风小模块 镜像id:2310
|
| | | /// </summary>
|
| | | Relay_FangyueFreshAirModul = 2310, |
| | | |
| | | //=========★★调光器类(2500-2799)★★========= |
| | | Relay_FangyueFreshAirModul = 2310,
|
| | | |
| | | //=========★★调光器类(2500-2799)★★=========
|
| | | /// <summary>
|
| | | /// 调光器
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 按键面板(200-1199)
|
| | | /// </summary>
|
| | | A按键面板 = 200, |
| | | A按键面板 = 200,
|
| | | /// <summary>
|
| | | /// 传感器(1200-2299)
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 继电器(2300-2499)
|
| | | /// </summary>
|
| | | A继电器 = 2300, |
| | | /// <summary>
|
| | | /// 新风
|
| | | /// </summary>
|
| | | A新风 = 2310,
|
| | | A继电器 = 2300,
|
| | | /// <summary>
|
| | | /// 调光器(2500-2799)
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 干接点
|
| | | /// </summary>
|
| | | A干接点 = 16, |
| | | A干接点 = 16,
|
| | | /// <summary>
|
| | | /// 新风
|
| | | /// </summary>
|
| | | A新风 = 17
|
| | | }
|
| | |
|
| | | #endregion
|