陈嘉乐
2021-03-12 94968f63b181eee088dab157881daf50ec5cb56a
2021-3-12-1

备份一下代码
7个文件已修改
214 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,23 +1,32 @@
<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/PirDevice/Pir.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="556" Column="32" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="372" Column="62" />
      <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="267" Column="73" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="284" Column="22" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="302" Column="63" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" Line="155" Column="67" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="165" Column="64" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="267" Column="70" />
      <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" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="59" Column="65" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" Line="357" Column="48" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="200" Column="66" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" Line="637" Column="18" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="13" Column="27" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Entity" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="Mqtt" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI2" expanded="True">
                  <Node name="3-Intelligence" expanded="True">
@@ -27,7 +36,7 @@
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True">
                      <Node name="Pir.cs" selected="True" />
                      <Node name="BrandList.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
@@ -48,10 +57,7 @@
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/hdl/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" line="323" column="1" />
      <Breakpoint file="/Users/hdl/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" line="138" column="1" />
    </BreakpointStore>
    <BreakpointStore />
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
</Properties>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs
@@ -8,7 +8,7 @@
    {
        public AddButton()
        {
            Tag = "Pir";
            Tag = "PirView";
        }
        public void Show(Control control)
        {
@@ -170,7 +170,7 @@
                        else
                        {
                            replication.RemView();
                            new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                            new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                        }
                     
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
@@ -9,7 +9,7 @@
    {
        public AddControl()
        {
            Tag = "Pir";
            Tag = "PirView";
        }
        public void Show(Control control)
        {
@@ -151,7 +151,6 @@
                        view.RemoveFromParent();
                    }
                }
                //MainPage.BasePageView.RemoveViewByTag("Pir");
                AddControlComplete addControlComplete = new AddControlComplete();
                MainPage.BasePageView.AddChidren(addControlComplete);
                addControlComplete.Show(control,false);
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
@@ -8,17 +8,24 @@
    {
        public AddControlComplete()
        {
            Tag = "Pir";
            Tag = "PirView";
        }
        public void Show(Control control, bool bool_library)
        {
            //数据转换
            Entity.Function function = new Entity.Function();
            function.sid = control.sid;
            function.deviceId = control.deviceId;
            function.name = control.name;
            function.spk = control.spk;
            function.attributes.AddRange(function.attributes);
            {
                function.sid = control.sid;
                function.deviceId = control.deviceId;
                function.name = control.name;
                function.spk = control.spk;
                //function.attributes.AddRange(control.status);
                //遥控器添加到列表;
                if (null == Pir.currPir.FunctioList.Find((c) => c.sid == function.sid))
                {
                    Pir.currPir.FunctioList.Add(function);
                }
            }
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
@@ -193,16 +200,12 @@
            //完成点击事件
            saveView.btnClick.MouseUpEventHandler += (sender, e) =>
            {
                MainPage.BasePageView.RemoveViewByTag("AddControl");
                MainPage.BasePageView.RemoveViewByTag("Pir");
                if (null == Pir.currPir.FunctioList.Find((c) => c.sid == function.sid))
                {
                    Pir.currPir.FunctioList.Add(function);
                }
                //Entity.FunctionAttributes functionAttributes = new Entity.FunctionAttributes();
                //functionAttributes.key
                //前面界面
               // this.RemoveFromParent();
                MainPage.BasePageView.RemoveViewByTag("PirView");
                //主界面
                MainPage.BasePageView.RemoveViewByTag("PirMain");
            };
            #endregion
        }
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -140,10 +140,12 @@
            fLayout.AddChidren(succeedBtn);
            #endregion
            #region 点击事件
            //表示库列表索引值
            int index= 1;
            //表示测试码索引值
            //表示库列表索引值(目前只20个库)
            int index = 1;
            //表示测试码索引值(目前只测试3个码)
            int code = 1;
            //表示测试最后一个码;
            bool if_bool = false;
            //左
            leftIconBtn.MouseUpEventHandler += (sender, e) =>
            {
@@ -165,22 +167,31 @@
                code = 1;
                GetBtnText(testBtn, code, spk);
            };
            //测试Text
            testBtn.MouseUpEventHandler += (sender, e) =>
            {
                var library = libraryList[index];
                var control = GetControl(spk, testBtn.TextID, library);
                //发送测试码命令
                CodeTest(control);
                if (code == 3) {
                    //标记最后那个码
                    if_bool = true;
                }
            };
            //控制失败
            failedBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (index < 20)
                {
                    //先加
                    index++;
                    //更新文本
                    sumBtn.Text = "(" + index.ToString() + "/20)";
                }
                code = 1;
                //更新状态
                GetBtnText(testBtn, code, spk);
            };
            //控制成功
@@ -190,17 +201,20 @@
                {
                    code++;
                }
                //更新状态
                GetBtnText(testBtn, code, spk);
                if (code == 3)
                if (if_bool)
                {
                    var library = libraryList[index];
                    var control = GetControl(spk, testBtn.TextID, library);
                    Method method = new Method();
                    method.ThreadAddControl(control, this,(cont) => {
                    //发送库添加遥控器命令
                    method.ThreadAddControl(control, this, (cont) =>
                    {
                        MainPage.BasePageView.RemoveViewByTag("PirView");
                        AddControlComplete addControlComplete = new AddControlComplete();
                        MainPage.BasePageView.AddChidren(addControlComplete);
                        addControlComplete.Show(cont,true);
                        addControlComplete.Show(cont, true);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    });
@@ -325,8 +339,8 @@
                        }
                        else
                        {
                            Method method = new Method();
                            method.ErrorShow(responsePackNew);
                            //Method method = new Method();
                            //method.ErrorShow(responsePackNew);
                        }
                    });
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs
@@ -228,7 +228,8 @@
        /// <summary>
        /// 获取遥控器列表
        /// </summary>
        public static void GetControlList(Action actio)
        /// <param name="action">回调函数</param>
        public static void GetControlList(Action action)
        {
            new System.Threading.Thread(() =>
@@ -272,81 +273,10 @@
                    Application.RunOnMainThread(() =>
                    {
                        actio();
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 获取遥控器列表
        /// </summary>
        /// <param name="frame">log图标加载界面</param>
        /// <param name="action">回调函数</param>
        public static void GetControlList1(FrameLayout frame, Action action)
        {
            //加载log
            Loading loading = new Loading();
            frame.AddChidren(loading);
            HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
            loading.Start();
            new System.Threading.Thread(() =>
            {
                try
                {
                    for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                    {
                        var pirDevice = Pir.pirDeviceList[i];
                        try
                        {
                            responsePackNew = PirSend.ControlList(pirDevice);
                        }
                        catch { }
                        finally
                        {
                            Application.RunOnMainThread(() =>
                            {
                                try
                                {
                                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                                    {
                                        var jArray = Newtonsoft.Json.Linq.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.sid == pirJosn.sid))
                                                {
                                                    pirDevice.FunctioList.Add(pirJosn);
                                                }
                                            }
                                        }
                                    }
                                }
                                catch { }
                            });
                        }
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        action();
                    });
                }
            })
            { IsBackground = true }.Start();
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>