| | |
| | | Shared.IO.FileUtils.WriteFileByBytes(picFullName, btnPic.ImageBytes);
|
| | | newRoom.BackgroundImage = picName;
|
| | | //备份
|
| | | Phone.UserCenter.HdlAutoBackupLogic.AddOrEditorFile(picName);
|
| | | HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(picName);
|
| | | }
|
| | |
|
| | | newRoom.FloorId = this.floorKeys;
|
| | |
| | | private void ShowTemperatrueDevice(NormalViewControl btnTemper)
|
| | | {
|
| | | var listDevice = new List<ZigBee.Device.CommonDevice>();
|
| | | foreach (var device in Common.LocalDevice.Current.listAllDevice)
|
| | | foreach (var device in HdlDeviceCommonLogic.Current.listAllDevice)
|
| | | {
|
| | | //获取温度传感器
|
| | | if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1)
|
| | |
| | | btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uNothing);
|
| | | return;
|
| | | }
|
| | | newRoom.TemperatrueDevice = Common.LocalDevice.Current.GetDeviceMainKeys(list[0]);
|
| | | newRoom.TemperatrueDevice = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(list[0]);
|
| | | //获取温度值
|
| | | this.GetTemperatrueValue(btnTemper, newRoom.TemperatrueDevice);
|
| | | };
|
| | |
| | | /// <param name="deviceKey"></param>
|
| | | private void GetTemperatrueValue(NormalViewControl btnTemper, string deviceKey)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKey);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKey);
|
| | | if (device == null)
|
| | | {
|
| | | return;
|
| | |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, ((report) =>
|
| | | {
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
|
| | | string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(report);
|
| | | if (newRoom.TemperatrueDevice != mainKeys || btnTemper == null
|
| | | || report.DeviceStatusReport.CluterID != 1026)
|
| | | {
|
| | |
| | | {
|
| | | //去获取设备列表的信息
|
| | | System.Threading.Thread.Sleep(1500);
|
| | | var result = Common.LocalDevice.Current.ReadDeviceEpointDeviceInfo(device);
|
| | | var result = HdlDeviceCommonLogic.Current.ReadDeviceEpointDeviceInfo(device);
|
| | | if (result != null)
|
| | | {
|
| | | device.AttributeStatus.Clear();
|
| | |
| | | private void ShowHumidityDevice(NormalViewControl btnHumi)
|
| | | {
|
| | | var listDevice = new List<ZigBee.Device.CommonDevice>();
|
| | | foreach (var device in Common.LocalDevice.Current.listAllDevice)
|
| | | foreach (var device in HdlDeviceCommonLogic.Current.listAllDevice)
|
| | | {
|
| | | //获取湿度传感器
|
| | | if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 2)
|
| | |
| | | btnHumi.Text = Language.StringByID(R.MyInternationalizationString.uNothing);
|
| | | return;
|
| | | }
|
| | | newRoom.HumidityDevice = Common.LocalDevice.Current.GetDeviceMainKeys(list[0]);
|
| | | newRoom.HumidityDevice = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(list[0]);
|
| | | //获取湿度值
|
| | | this.GetHumidityValue(btnHumi, newRoom.HumidityDevice);
|
| | | };
|
| | |
| | | /// <param name="deviceKey"></param>
|
| | | private void GetHumidityValue(NormalViewControl btnHumi, string deviceKey)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKey);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKey);
|
| | | if (device == null)
|
| | | {
|
| | | return;
|
| | |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice");
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A设备属性上报, (report) =>
|
| | | {
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
|
| | | string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(report);
|
| | | if (newRoom.HumidityDevice != mainKeys || btnHumi == null
|
| | | || report.DeviceStatusReport.CluterID != 1029)
|
| | | {
|
| | |
| | | {
|
| | | //去获取设备列表的信息
|
| | | System.Threading.Thread.Sleep(1500);
|
| | | var result = Common.LocalDevice.Current.ReadDeviceEpointDeviceInfo(device);
|
| | | var result = HdlDeviceCommonLogic.Current.ReadDeviceEpointDeviceInfo(device);
|
| | | if (result != null)
|
| | | {
|
| | | device.AttributeStatus.Clear();
|