From 2b380862ab304f049ae7181a058b0791671d1bb4 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 23 二月 2021 09:39:54 +0800 Subject: [PATCH] 2021-02-23 1.增加场景数据转换和上传测试方法。2.增加风扇和通用开关设备spk --- Crabtree/SmartHome/HDL/Operation/Device/Scene.cs | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs b/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs index d1ef92d..9eecb3a 100644 --- a/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs +++ b/Crabtree/SmartHome/HDL/Operation/Device/Scene.cs @@ -9,16 +9,16 @@ /// <summary> /// 鍦烘櫙 /// </summary> -[System.Serializable] + [System.Serializable] public class Scene : Common { public readonly static string GlobalSceneFilePath = "GlobalScene"; static Scene () { - Refresh (); + Refresh (); } - public static void Refresh() + public static void Refresh () { if (null == Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>> (Encoding.UTF8.GetString (IO.FileUtils.ReadFile (GlobalSceneFilePath)))) { //鍒濆鍖栨埧闂村垪琛� @@ -30,10 +30,18 @@ { this.Type = DeviceType.Scene; DeviceTextID = SimpleControl.R.MyInternationalizationString.Scenes; + + if (string.IsNullOrEmpty (SceneID)) { + SceneID = Guid.NewGuid ().ToString (); + } } - + + /// <summary> + /// 鍦烘櫙鍞竴ID + /// </summary> + public string SceneID = ""; /// <summary> /// 鍦烘櫙灏忓浘鏍� @@ -98,6 +106,6 @@ //var ssfsdf = IO.FileUtils.ReadFile ("GlobalScene_busScene"); //var cp = CommonPage.MyEncodingUTF8.GetString (ssfsdf); } - + } } \ No newline at end of file -- Gitblit v1.8.0