File was renamed from HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs |
| | |
| | | |
| | | namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice |
| | | { |
| | | public class Method |
| | | public class PirMethod |
| | | { |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | 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> |
| | |
| | | { |
| | | |
| | | if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) |
| | | {
|
| | | { |
| | | PirDevice.Pir.pirDeviceList.Add(pirJosn); |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | loading.Hide(); |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(null, "读取红外宝列表失败"); |
| | | } |
| | | } |
| | |
| | | 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]; |
| | | //数据返序列化为Logic对象 |
| | | 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]; |
| | | //数据返序列化为Logic对象 |
| | | 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> |
| | |
| | | /// <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 |
| | |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | //自定义错误提示文本 |
| | | string eorroText = ""; |
| | | if (str == "删除") |
| | |
| | | |
| | | } |
| | | 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); |
| | |
| | | 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>(); |