From c0379d078e7919c9934085da038e8e3c20dee85a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 25 二月 2021 19:26:06 +0800 Subject: [PATCH] 2021-02-25 1.增加语音设备选择。2.增加场景全量更新上传。 --- Crabtree/SmartHome/HDL/Operation/Device/Scene.cs | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs b/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs index 9eecb3a..e4ff071 100644 --- a/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs +++ b/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs @@ -31,9 +31,6 @@ this.Type = DeviceType.Scene; DeviceTextID = SimpleControl.R.MyInternationalizationString.Scenes; - if (string.IsNullOrEmpty (SceneID)) { - SceneID = Guid.NewGuid ().ToString (); - } } @@ -41,7 +38,7 @@ /// <summary> /// 鍦烘櫙鍞竴ID /// </summary> - public string SceneID = ""; + public string Sid = ""; /// <summary> /// 鍦烘櫙灏忓浘鏍� @@ -52,6 +49,11 @@ /// 鍦烘櫙鐨勮儗鏅浘 /// </summary> public string BackgroundImagePath = "Scene/s1.png"; + + /// <summary> + /// 鍦烘櫙淇濆瓨璺緞 + /// </summary> + public string SceneFilePath = ""; /// <summary> /// 鏍规嵁鍦烘櫙璺緞鎭㈠鍦烘櫙瀵硅薄 @@ -83,6 +85,10 @@ /// <param name="sceneFilePath">Scence file path.</param> public void Save (string sceneFilePath) { + if(string.IsNullOrEmpty(this.SceneFilePath) || this.SceneFilePath != sceneFilePath) { + this.SceneFilePath = sceneFilePath; + } + IO.FileUtils.WriteFileByBytes (sceneFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (this))); } -- Gitblit v1.8.0