HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-10-12 dc6493db59dcb0893eac50b72122f94c24056b3f
ZigbeeApp/Shared/Phone/TemplateData/TemplateCommonLogic.cs
@@ -638,6 +638,7 @@
                    //本地备份保存成功
                    this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.SaveLocalBackDataSuccess));
                }
                ProgressFormBar.Current.Close();
            });
        }
@@ -722,6 +723,7 @@
                    {
                        var homeInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<TemplateHomeInfo>(homeData);
                        myModel.ListUintContent.AddRange(homeInfo.ListUintContent);
                        myModel.ListUintName.AddRange(homeInfo.ListUintName);
                        myModel.ResidenceAddressName = homeInfo.ResidenceAddressName;
                    }
                }
@@ -786,6 +788,15 @@
        public string GetNewTemplateFileName()
        {
            return "ModelData_Local_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".bin";
        }
        /// <summary>
        /// 获取一个新的模板保存文件名
        /// </summary>
        /// <returns></returns>
        public string GetNewTemplateFileName(DateTime dateTime)
        {
            return "ModelData_Local_" + dateTime.ToString("yyyyMMdd_HHmmss") + ".bin";
        }
        #endregion
@@ -1058,7 +1069,6 @@
            var modelData = new LocalModelBaseInfo();
            modelData.EditorTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm");
            modelData.ModelName = backUpName;
            modelData.ListUintContent.AddRange(Common.Config.Instance.Home.ListUintContent);
            modelData.FloorCount = Common.Config.Instance.Home.FloorDics.Count;
            modelData.DeviceCount = this.modelData.dicDeviceTemplateData.Count;
            //功能数
@@ -1087,6 +1097,7 @@
        {
            var homeData = new TemplateHomeInfo();
            homeData.ResidenceAddressName = Common.Config.Instance.Home.ResidenceAddressName;
            homeData.ListUintName.AddRange(Common.Config.Instance.Home.ListUintName);
            homeData.ListUintContent.AddRange(Common.Config.Instance.Home.ListUintContent);
            writeText += "#START#\r\n";
@@ -1284,6 +1295,12 @@
        {
            //获取本地指定的Mac的全部设备
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(sourceMac, false);
            var otaDevice = Common.LocalDevice.Current.GetOTADevice(sourceMac);
            if (otaDevice != null)
            {
                //这里ota设备也要加进去,重中之重
                listDevice.Add(otaDevice);
            }
            foreach (var device in listDevice)
            {
@@ -1291,7 +1308,8 @@
                string localDeviceKey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                string templateDeviceKey = Common.LocalDevice.Current.GetDeviceMainKeys(targetMac, device.DeviceEpoint);
                if (this.modelData.dicDeviceTemplateRoom.ContainsKey(templateDeviceKey) == true)
                if (this.modelData.dicDeviceTemplateRoom.ContainsKey(templateDeviceKey) == true
                    && (device is OTADevice) == false)
                {
                    //如果模板里面,这个端点设置有房间的话
                    HdlRoomLogic.Current.ChangedRoom(device, this.modelData.dicDeviceTemplateRoom[templateDeviceKey], false);
@@ -1701,7 +1719,7 @@
            //保存路径
            string saveFile = DirNameResourse.LocalTemplateDirectory;
            saveFile = System.IO.Path.Combine(saveFile, mainkey);
            saveFile = System.IO.Path.Combine(saveFile, "Device_" + mainkey);
            var listData = this.modelData.dicDeviceTemplateData[mainkey];
            if (listData.Count == 0)