陈嘉乐
2021-03-11 e8b9a8ec533094c6e3f262f64a73810f768a59ff
2021-3-11-2
3个文件已修改
130 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,26 +1,22 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-001674E61438002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="10" Column="23" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="84" Column="43" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="98" Column="54" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="556" Column="32" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="250" Column="36" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="31" Column="36" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="299" Column="32" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" Line="1" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="137" Column="63" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="271" Column="25" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="267" Column="73" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs" Line="14" Column="91" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="26" Column="35" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="DriverLayer" expanded="True" />
                <Node name="Mqtt" expanded="True" />
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True" />
              <Node name="UI" expanded="True">
                <Node name="UI2" expanded="True">
@@ -30,8 +26,9 @@
                    </Node>
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True" />
                    <Node name="PersonalCenterPageBLL.cs" selected="True" />
                    <Node name="PirDevice" expanded="True">
                      <Node name="Pir.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs
@@ -28,12 +28,12 @@
        /// <param name="list">当前存在名称列表</param>
        /// <param name="currName">当前名称</param>
        /// <param name="action">回调函数</param>
        public void EditControlName(int tipText ,List<string> list, string currName, Action<string, Dialog> action,Action actionCancel, bool tag=false)
        public void EditControlName(int tipText, List<string> list, string currName, Action<string, Dialog> action, Action actionCancel, bool tag = false)
        {
            new View.TipView().InputBox(tipText, currName, StringId.nameNull, StringId.NameAlreadyExists, list, (text, view
                ) =>
            {
                action(text,view);
                action(text, view);
            }, () => { actionCancel(); }, tag);
        }
        /// <summary>
@@ -190,8 +190,6 @@
                            }
                        }
                        //GetControlList(frame, action);
                       // GetControlList();
                    }
                }
@@ -200,20 +198,22 @@
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                       // action();
                        try
                        {
                            if (Pir.pirDeviceList.Count != 0)
                            {
                                GetControlList1(frame, action);
                                var list = Pir.pirDeviceList;
                                GetControlList(() =>
                                {
                                    loading.Hide();
                                    action();
                                });
                            }
                            else
                            {
                                //Method method = new Method();
                                //method.ErrorShow(responsePackNew);
                                loading.Hide();
                                Method method = new Method();
                                method.ErrorShow(null,"读取红外宝列表失败");
                            }
                        }
                        catch { }
@@ -228,43 +228,53 @@
        /// <summary>
        /// 获取遥控器列表
        /// </summary>
        public static void GetControlList()
        public static void GetControlList(Action actio)
        {
            new System.Threading.Thread(() =>
            {
                for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                try
                {
                    var pirDevice = Pir.pirDeviceList[i];
                    try
                    for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                    {
                        var responsePackNew = PirSend.ControlList(pirDevice);
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        var pirDevice = Pir.pirDeviceList[i];
                        try
                        {
                            var jArray = JArray.Parse(responsePackNew.Data.ToString());
                            for (int a = 0; a < jArray.Count; a++)
                            var responsePackNew = PirSend.ControlList(pirDevice);
                            if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                            {
                                var jay = jArray[a];
                                //数据返序列化为Logic对象
                                var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
                                var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str);
                                if (pirJosn != null)
                                var jArray = JArray.Parse(responsePackNew.Data.ToString());
                                for (int a = 0; a < jArray.Count; a++)
                                {
                                    if (null == pirDevice.FunctioList.Find((c) => c.sid == pirJosn.sid))
                                    var jay = jArray[a];
                                    //数据返序列化为Logic对象
                                    var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
                                    var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str);
                                    if (pirJosn != null)
                                    {
                                        pirDevice.FunctioList.Add(pirJosn);
                                        if (null == pirDevice.FunctioList.Find((c) => c.sid == pirJosn.sid))
                                        {
                                            pirDevice.FunctioList.Add(pirJosn);
                                        }
                                    }
                                }
                                }
                            }
                        }
                        catch { }
                    }
                    catch { }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        actio();
                    });
                }
            })
            { IsBackground = true }.Start();
@@ -426,11 +436,14 @@
        /// </summary>
        /// <param name="responsePackNew"></param>
        /// <param name="str"></param>
        public void ErrorShow(ResponsePackNew responsePackNew, string str = "")
        public void ErrorShow(ResponsePackNew responsePackNew=null, string str = "")
        {
            if (str == "删除遥控器")
            {
                new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail));
            } else if (str == "读取红外宝列表失败") {
                new Intelligence.Automation.LogicView.TipPopView().FlashingBox("读取红外宝列表失败");
            }
            else
            {
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs
@@ -25,22 +25,22 @@
    [System.Serializable]
    public class Control
    {
        /// <summary>
        /// 红外宝设备Id
        /// </summary>
        public string deviceId = "";
        /// <summary>
        /// sid
        /// </summary>
        public string sid = "";
        /// <summary>
        /// 红外遥控器名称
        /// </summary>
        public string name = "";
        /// <summary>
        /// 红外遥控器spk
        /// </summary>
        public string spk = "ir.module";
        ///// <summary>
        ///// 红外宝设备Id
        ///// </summary>
        //public string deviceId = "";
        ///// <summary>
        ///// sid
        ///// </summary>
        //public string sid = "";
        ///// <summary>
        ///// 红外遥控器名称
        ///// </summary>
        //public string name = "";
        ///// <summary>
        ///// 红外遥控器spk
        ///// </summary>
        //public string spk = "ir.module";
        /// <summary>
        /// library=库类型, learn=不需要额外追加属性
        /// </summary>