黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs
@@ -160,7 +160,7 @@
                if (bolSave == true)
                {
                    //删掉这个文件,重新生成
                    HdlAutoBackupLogic.DeleteFile(file);
                    HdlBackupLogic.Current.DeleteAutoBackFileStatu(file);
                    Global.DeleteFilebyHomeId(file);
                }
@@ -170,7 +170,7 @@
                    //不存在的话,重新生成
                    device.IconPath = string.Empty;
                    device.ReSave();
                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                    bolSave = false;
                }
@@ -178,7 +178,7 @@
                if (bolSave == true)
                {
                    device.ReSave();
                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                }
            }
            //成员身份的时候,删除掉非法的网关文件
@@ -393,7 +393,7 @@
                if (exists == false)
                {
                    //添加自动备份
                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                }
                return;
            }
@@ -431,7 +431,7 @@
            if (exists2 == false)
            {
                //添加自动备份
                HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
                HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
            }
        }
@@ -631,7 +631,7 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
                return Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
            }
            //获取编辑设备Mac名字的命令字符
@@ -642,7 +642,7 @@
                return null;
            }
            //加缓存
            Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
            Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
            var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RenameDeviceMacNameData>(result.ReceiptData);
            return new CommonDevice.RenameDeviceMacNameAllData { renameDeviceMacNameData = tempData };
@@ -659,7 +659,7 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
                return Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
            }
            //获取编辑设备端点名字的命令字符
            var sendData = this.GetReDeviceEpointNameCommandText(device.DeviceAddr, device.DeviceEpoint, deviceName);
@@ -669,7 +669,7 @@
                return null;
            }
            //加缓存
            Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
            Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
            var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceRenameResponseData>(result.ReceiptData);
            return new CommonDevice.DeviceRenameAllData { deviceRenameData = tempData };
@@ -732,7 +732,7 @@
                    device.ReSave();
                    //添加自动备份
                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                }
                else if (this.dicOTADevice.ContainsKey(mainKeys) == true)
                {
@@ -741,7 +741,7 @@
                    device.ReSave();
                    //添加自动备份
                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                }
            }
@@ -825,7 +825,7 @@
                }
            }
            //删除模板数据
            Phone.TemplateData.TemplateCommonLogic.Current.DeleteDevice(device);
            Phone.HdlTemplateCommonLogic.Current.DeleteDevice(device);
            //删除设备文件
            string filePath = device.FilePath;
@@ -841,7 +841,7 @@
                    //变更:搞掉它,不留了
                    Global.DeleteFilebyHomeId(filePath);
                    //删除自动备份
                    HdlAutoBackupLogic.DeleteFile(device.FilePath);
                    HdlBackupLogic.Current.DeleteAutoBackFileStatu(device.FilePath);
                }
            }
        }
@@ -870,7 +870,7 @@
                        //变更:搞掉它,不留了
                        Global.DeleteFilebyHomeId(otaFile);
                        //删除自动备份
                        HdlAutoBackupLogic.DeleteFile(otaFile);
                        HdlBackupLogic.Current.DeleteAutoBackFileStatu(otaFile);
                    }
                }
                this.dicOTADevice.Remove(otaKeys);
@@ -1468,7 +1468,7 @@
                        {
                            //重新生成缓存
                            tempDevice.ReSave();
                            HdlAutoBackupLogic.AddOrEditorFile(tempDevice.FilePath);
                            HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(tempDevice.FilePath);
                            //全部主页菜单需要刷新
                            Phone.UserView.UserPage.Instance.RefreshAllForm = true;
                        }
@@ -1720,7 +1720,7 @@
            device.IsCustomizeImage = true;
            device.ReSave();
            HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
            HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
        }
        /// <summary>
@@ -3170,7 +3170,7 @@
                                {
                                    //重新生成缓存
                                    tempDevice.ReSave();
                                    HdlAutoBackupLogic.AddOrEditorFile(tempDevice.FilePath);
                                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(tempDevice.FilePath);
                                    //全部主页菜单需要刷新
                                    Phone.UserView.UserPage.Instance.RefreshAllForm = true;
                                }
@@ -3327,7 +3327,7 @@
            }
            //删除本地文件
            HdlFileLogic.Current.DeleteFile(oldFile);
            HdlAutoBackupLogic.DeleteFile(oldLocalDevice.FilePath);
            HdlBackupLogic.Current.DeleteAutoBackFileStatu(oldLocalDevice.FilePath);
            //重新生成文件
            if (newDevice.IsCustomizeImage == false)
@@ -3835,7 +3835,22 @@
            }
            myGateway.Actions -= receiptAction;
            receiptAction = null;
            if (listCheckTopic.Count != listReceiptTopic.Count)
            int receveCount = listCheckTopic.Count;
            if (receveCount > 1)
            {
                //看看里面有没有重复的
                var listTemp = new HashSet<string>();
                foreach (var value in listCheckTopic)
                {
                    if (listTemp.Contains(value) == false)
                    {
                        listTemp.Add(value);
                    }
                }
                receveCount = listTemp.Count;
            }
            if (receveCount != listReceiptTopic.Count)
            {
                reResult.ErrorMsgDiv = 0;
            }