From 4d14154c36ac5692aadc036eed97fb9f1c410e2a Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期日, 23 五月 2021 14:46:03 +0800 Subject: [PATCH] Merge branch 'WJC' into temp-wxr --- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs | 101 +++++++++++++++++++++++++++++--------------------- 1 files changed, 59 insertions(+), 42 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs similarity index 90% rename from HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs rename to HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs index 064080f..f8d4655 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs @@ -6,7 +6,7 @@ namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice { - public class Method + public class PirMethod { /// <summary> @@ -79,22 +79,22 @@ { View.TipView tipView = new View.TipView(); tipView.InputBox(frameLayout, "", (name, frame) => - { - if (Pir.currPir != null && Pir.currPir.FunctioList.Count < 10) - { - Control control = new Control(); - control.name = name; - control.type = "learn"; - control.spk = "ir.learn"; - control.deviceId = Pir.currPir.deviceId; - ThreadAddControl(control, frame, action); - } - else - { - View.TipView tt = new View.TipView(); - tt.TipBox(StringId.tip, StringId.bunengchaoguo10); - } - }, false); + { + if (Pir.currPir != null && Pir.currPir.FunctioList.Count < 10) + { + Control control = new Control(); + control.name = name; + control.type = "learn"; + control.spk = "ir.learn"; + control.deviceId = Pir.currPir.deviceId; + ThreadAddControl(control, frame, action); + } + else + { + View.TipView tt = new View.TipView(); + tt.TipBox(StringId.tip, StringId.bunengchaoguo10); + } + }, false); } /// <summary> @@ -223,7 +223,7 @@ { if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) - { + { PirDevice.Pir.pirDeviceList.Add(pirJosn); } } @@ -252,7 +252,7 @@ else { loading.Hide(); - Method method = new Method(); + PirMethod method = new PirMethod(); method.ErrorShow(null, "璇诲彇绾㈠瀹濆垪琛ㄥけ璐�"); } } @@ -329,24 +329,24 @@ public static void GetControlList(FrameLayout frame, Action action, Pir pirDevice) { ThreadSend(new Control { deviceId = pirDevice.deviceId }, (responsePackNew) => - { - var jArray = JArray.Parse(responsePackNew.Data.ToString()); - for (int a = 0; a < jArray.Count; a++) - { - var jay = jArray[a]; - //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄 - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); - if (pirJosn != null) - { - if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId)) - { - pirDevice.FunctioList.Add(pirJosn); - } - } - } - action(); - }, "鑾峰彇閬ユ帶鍣ㄥ垪琛�", "frame", frame, null); + { + var jArray = JArray.Parse(responsePackNew.Data.ToString()); + for (int a = 0; a < jArray.Count; a++) + { + var jay = jArray[a]; + //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄 + var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); + var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); + if (pirJosn != null) + { + if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId)) + { + pirDevice.FunctioList.Add(pirJosn); + } + } + } + action(); + }, "鑾峰彇閬ユ帶鍣ㄥ垪琛�", "frame", frame, null); } /// <summary> @@ -373,7 +373,7 @@ /// <param name="frame">log鐖舵帶浠�</param> /// <param name="dialog">log鐖舵帶浠�</param> /// <param name="attributesStatus">瀛︿範鎸夐敭</param> - public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, Entity.AttributesStatus attributesStatus=null) + public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, Entity.AttributesStatus attributesStatus = null) { //鍔犺浇log @@ -434,7 +434,7 @@ } else { - Method method = new Method(); + PirMethod method = new PirMethod(); //鑷畾涔夐敊璇彁绀烘枃鏈� string eorroText = ""; if (str == "鍒犻櫎") @@ -565,6 +565,26 @@ } break; + case "14002": + { + str = Language.StringByID(StringId.bucunzaichanpin); + } + break; + case "10805": + { + str = Language.StringByID(StringId.shebeibucunzai); + } + break; + case "14006": + { + str = Language.StringByID(StringId.shebeibuzaixian); + } + break; + case "9": + { + str = Language.StringByID(StringId.wangguanshebeibuzaixian); + } + break; case "2": { str = Language.StringByID(StringId.xitongweihuzhong); @@ -671,13 +691,10 @@ public string id = ""; public List<Objects> objects = new List<Objects>(); public string time_stamp = string.Empty; - - } [Serializable] public class Objects { - public string sid = string.Empty; public string spk = string.Empty; public List<Attributes> attributes = new List<Attributes>(); -- Gitblit v1.8.0