陈嘉乐
2021-03-08 6ae83acae578c6746201fbd61074a7b93747ef4f
2021-3-8-4
11个文件已修改
13530 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 13260 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_APP_Project.sln 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,51 +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/PirDevice/Method.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="55" Column="24" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="292" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="170" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="12" Column="33" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="10" Column="23" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs" Line="50" Column="46" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/SaveView.cs" Line="11" Column="57" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="267" Column="70" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="435" Column="63" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs" Line="147" Column="32" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs" Line="8" Column="16" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs" Line="252" Column="18" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="242" Column="42" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="88" Column="86" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" />
      <File FileName="HDL_ON/Entity/FunctionList.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" />
    </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="Mqtt" expanded="True" />
                <Node name="Server" 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">
                    <Node name="Automation" expanded="True" />
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True">
                      <Node name="View" expanded="True" />
                      <Node name="Method.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
            </Node>
          </Node>
        </State>
      </Pad>
    </Pads>
  </MonoDevelop.Ide.Workbench>
  <MonoDevelop.Ide.DebuggingService.PinnedWatches />
  <DisabledProjects>
HDL-ON_Android/Resources/Resource.designer.cs
Diff too large
HDL_APP_Project.sln
@@ -9,6 +9,8 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blufi", "HdlBluWi\Blufi.csproj", "{2DDF4C3C-6998-432E-9F43-6786D82F0630}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ys", "ys\ys.csproj", "{DF065E3F-C3A1-4908-9582-000974B7C290}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
@@ -55,5 +57,17 @@
        {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhone.Build.0 = Debug|Any CPU
        {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.ActiveCfg = Release|Any CPU
        {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.Build.0 = Release|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|Any CPU.Build.0 = Release|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhone.ActiveCfg = Debug|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhone.Build.0 = Debug|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhone.ActiveCfg = Release|Any CPU
        {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhone.Build.0 = Release|Any CPU
    EndGlobalSection
EndGlobal
HDL_ON/DAL/Server/NewAPI.cs
@@ -525,8 +525,7 @@
        #endregion
        #endregion
        #endregion
    }
    ///// <summary>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs
@@ -125,49 +125,48 @@
                replication.Show();
                //添加数据对象
                ButtonObj buttonObj = new ButtonObj();
                buttonObj.Key = "key" + Pir.BuottonList.Count.ToString();
                Entity.AttributesStatus buttonObj = new Entity.AttributesStatus();
                buttonObj.key = "key" + Pir.BuottonList.Count.ToString();
                buttonObj.value = texts;
                PirSend.CodeStudy(buttonObj, (responsePackNew) =>
                PirSend.CodeStudy(control, buttonObj, (responsePackNew) =>
                {
                    ///这里:监听MTTP推送下来主题,才知道是否添加成功
                    ///
                    //休眠是为显示引导界面
                      System.Threading.Thread.Sleep(5000);
                    System.Threading.Thread.Sleep(5000);
                    //移除添加按钮引导界面
                    replication.RemView();
                    //if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    //{
                    var buttonName = Pir.BuottonList.Find((c) => c.value == buttonObj.value);
                    if (buttonName == null)
                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    {
                        //添加数据
                        Pir.BuottonList.Add(buttonObj);
                    }
                    //移除添加按钮界面
                    this.RemoveFromParent();
                    for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                    {
                        var view = MainPage.BasePageView.GetChildren(i);
                        if (view.GetType() == typeof(AddControl))
                        var buttonName = Pir.BuottonList.Find((c) => c.value == buttonObj.value);
                        if (buttonName == null)
                        {
                            view.RemoveFromParent();
                            //添加数据
                            Pir.BuottonList.Add(buttonObj);
                        }
                        //移除添加按钮界面
                        this.RemoveFromParent();
                        for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                        {
                            var view = MainPage.BasePageView.GetChildren(i);
                            if (view.GetType() == typeof(AddControl))
                            {
                                view.RemoveFromParent();
                            }
                        }
                        //加载数据界面
                        AddControl addControl = new AddControl();
                        MainPage.BasePageView.AddChidren(addControl);
                        addControl.Show(control);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    }
                    //加载数据界面
                    AddControl addControl = new AddControl();
                    MainPage.BasePageView.AddChidren(addControl);
                    addControl.Show(control);
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    //}
                    //else
                    //{
                    //    PirSend.Error(responsePackNew);
                    //}
                    else
                    {
                        Method method = new Method();
                        method.ErrorShow(responsePackNew);
                    }
                });
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
@@ -223,7 +223,7 @@
                //删除图标的点击事件
                delIconBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var obj = delIconBtn.Tag as ButtonObj;
                    var obj = delIconBtn.Tag as Entity.AttributesStatus;
                    //加载log
                    Loading loading = new Loading();
                    this.AddChidren(loading);
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -201,7 +201,7 @@
                for (int j = 0; j < pirDevice.FunctioList.Count; j++)
                {
                    var control = pirDevice.FunctioList[i];
                    var control = pirDevice.FunctioList[j];
                    RowLayout funControlRow = new RowLayout
                    {
                        Y = Application.GetRealHeight(92 + (50 * j)),
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -222,11 +222,11 @@
            string value = "";
            switch (spk)
            {
                case SPK.AcStandard:
                case SPK.AcIr:
                    {
                        switch (textInt)
                        {
                            case StringId.dianshi:
                            case StringId.dianyuan:
                                {
                                    key = "on_off";
                                    value = "on";
@@ -273,21 +273,24 @@
                    }
                    break;
            }
            ButtonObj buttonObj = new ButtonObj();
            buttonObj.Key = key;
            AttributesStatus buttonObj = new AttributesStatus();
            buttonObj.key = key;
            buttonObj.value = value;
            Control control = new Control();
            control.spk = spk;
            control.name = spk;
            control.group_id = library.irIndex;
            control.groupId = library.irIndex;
            control.type = "library";
            control.status.Add(buttonObj);
            control.deviceId = Pir.currPir.deviceId;
            string[] strings = library.irCode.Split(',');
            for (int array = 0; array < strings.Length; array++)
            for (int arrayStr = 0; arrayStr < strings.Length; arrayStr++)
            {
                //var intValue = Convert.ToInt32(strings[array],16);
                control.library.Add(strings[array]);
                //var intValue = Convert.ToInt32(strings[arrayStr],16);
                //intValue
                //control.library1.Add((uint)intValue);
                control.library.Add(strings[arrayStr].Replace("0x",""));
            }
            return control;
@@ -309,7 +312,6 @@
            {
                try
                {
                    //发送按键删除;
                    responsePackNew = PirSend.CodeTest(control);
                }
                catch { }
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs
@@ -18,18 +18,12 @@
             {
                 ///清除之前列表数据
                 Pir.BuottonList.Clear();
                 if (!string.IsNullOrEmpty(name))
                 {
                     Control control = new Control();
                     control.name = name;
                     control.type = "learn";
                     control.spk = "ir.learn";
                     control.deviceId = Pir.currPir.deviceId;
                     ThreadAddControl(control, frame, action);
                 }
                 Control control = new Control();
                 control.name = name;
                 control.type = "learn";
                 control.spk = "ir.learn";
                 control.deviceId = Pir.currPir.deviceId;
                 ThreadAddControl(control, frame, action);
             }, false);
        }
@@ -40,7 +34,6 @@
        /// <param name="frame"></param>
        public void ThreadAddControl(Control control, FrameLayout frame, Action<Control> action)
        {
            DAL.Server.ResponsePackNew responsePackNew = null;
            Loading loading = new Loading();
            frame.AddChidren(loading);
@@ -59,21 +52,14 @@
                        loading.Hide();
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                            bool bool_if = false;
                            string sid = responsePackNew.Data.ToString();
                            var mqttdate = MqttDate();
                            for (int i = 0; i < mqttdate.objects.Count; i++) {
                                var objects = mqttdate.objects[i];
                                if (sid == objects.sid) {
                                    bool_if = true;
                                    break;
                                }
                            }
                            if (bool_if)
                            var mqttdate = MqttDate(sid);
                            if (mqttdate.id!="")
                            {
                                ///这里:监听MTTP推送下来主题,才知道是否添加成功
                                frame.RemoveFromParent();//添加成功关闭弹窗
                                control.deviceId = mqttdate.id;
                                control.sid = sid;
                                action(control);
                            }
                            else
@@ -250,36 +236,32 @@
        /// </summary>
        public static string addcontronsid = "";
        /// <summary>
        ///
        /// 判断这个主题是否是添加遥控器主题
        /// </summary>
        /// <returns></returns>
        public Cloud MqttDate()
        public Cloud MqttDate(string sid)
        {
            Cloud cloud = new Cloud();
            var dateTime = DateTime.Now;
            while ((DateTime.Now - dateTime).TotalMilliseconds < 5 * 1000)
            while ((DateTime.Now - dateTime).TotalMilliseconds < 10 * 1000)
            {
                if (!string.IsNullOrEmpty(addcontronsid))
                {
                    cloud = Newtonsoft.Json.JsonConvert.DeserializeObject<Cloud>(addcontronsid);
                    for (int i = 0; i < cloud.objects.Count; i++)
                    {
                        var objects = cloud.objects[i];
                        if (sid == objects.sid)
                        {
                            break;
                        }
                    }
                    break;
                }
            }
            return PushData();
        }
        public Cloud PushData()
        {
            Cloud cloud = new Cloud();
            if (addcontronsid != "")
            {
                //var date = Newtonsoft.Json.JsonConvert.SerializeObject(addcontronsid);
                cloud = Newtonsoft.Json.JsonConvert.DeserializeObject<Cloud>(addcontronsid);
            }
            return cloud;
        }
        /// <summary>
        /// 错误码提示
@@ -307,7 +289,7 @@
        /// <summary>
        /// 设备id
        /// </summary>
        public string id = string.Empty;
        public string id ="";
        public List<Objects> objects = new List<Objects>();
        public string time_stamp = string.Empty;
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice
{
    [System.Serializable]
@@ -8,7 +10,7 @@
        /// <summary>
        /// 添加按键列表
        /// </summary>
        public static List<ButtonObj> BuottonList = new List<ButtonObj>();
        public static List<AttributesStatus> BuottonList = new List<AttributesStatus>();
        public static List<Pir> pirDeviceList = new List<Pir>();
        /// <summary>
        /// 当前逻辑
@@ -30,6 +32,10 @@
        /// </summary>
        public string deviceId = "0";
        /// <summary>
        /// sid
        /// </summary>
        public string sid = "0";
        /// <summary>
        /// 红外遥控器名称
        /// </summary>
        public string name = "0";
@@ -44,7 +50,7 @@
        /// <summary>
        /// 码组号
        /// </summary>
        public string group_id = "12";
        public string groupId = "12";
        /// <summary>
        /// 红外码
        /// </summary>
@@ -52,17 +58,9 @@
        /// <summary>
        /// 红外码
        /// </summary>
        public List<ButtonObj> status = new List<ButtonObj>();
        public List<AttributesStatus> status = new List<AttributesStatus>();
    }
    [System.Serializable]
    public class ButtonObj
    {
        public string Key = string.Empty;
        /// <summary>
        /// #app 显示的文字
        /// </summary>
        public string value = string.Empty;
    }
    [System.Serializable]
    public class DeviceType
    {
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -5,6 +5,7 @@
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using Shared;
using HDL_ON.Entity;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice
{
@@ -75,7 +76,7 @@
            jObject.Add("type", control.type);
            if (control.type=="library")
            {
                jObject.Add("group_id", control.group_id);
                jObject.Add("groupId", control.groupId);
                var libraryjay = new JArray { };
                for (int i = 0; i < control.library.Count; i++)
                {
@@ -97,8 +98,8 @@
            jObject.Add("homeId", HomeId);
            jObject.Add("deviceId", control.deviceId);
            jObject.Add("spk", control.spk);
            if (control.spk== Entity.SPK.AcStandard) {
                jObject.Add("group_id", control.group_id);
            if (control.spk== SPK.AcIr) {
                jObject.Add("groupId", control.groupId);
            }
            var libraryJay = new JArray { }; 
            for (int i = 0; i < control.library.Count; i++)
@@ -110,7 +111,7 @@
            {
                var statusJob = new JObject { };
                var job = control.status[i];
                statusJob.Add("key", job.Key);
                statusJob.Add("key", job.key);
                statusJob.Add("value", job.value);
                statusJay.Add(statusJob);
            }
@@ -124,7 +125,7 @@
        /// 红外码学习
        /// </summary>
        /// <returns></returns>
        public static void CodeStudy(ButtonObj buttonObj, Action<ResponsePackNew> action)
        public static void CodeStudy(Control control,AttributesStatus buttonObj,Action<ResponsePackNew> action)
        {
            //var whichDayJson = jay["whichDay"].ToString();
            //var whichDayAry = Newtonsoft.Json.Linq.JArray.Parse(whichDayJson);
@@ -134,14 +135,14 @@
            //    timer.whichDay.Add(int.Parse(days));
            //}
            var job = new JObject { };
            job.Add("key", buttonObj.Key);
            job.Add("key", buttonObj.key);
            job.Add("data_type", "string");
            var valuejArray = new JArray { };
            valuejArray.Add(buttonObj.value);
            job.Add("value", valuejArray);
            var jArray = new JArray { };
            jArray.Add(job);
            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", pirId }, { "attributes", jArray } };
            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", control.deviceId }, { "attributes", jArray } };
            ResponsePackNew responsePackNew = null;
            new System.Threading.Thread(() =>
            {
@@ -167,10 +168,10 @@
        /// 自学按键删除
        /// </summary>
        /// <returns></returns>
        public static ResponsePackNew CodeRemove(ButtonObj buttonObj)
        public static ResponsePackNew CodeRemove(AttributesStatus buttonObj)
        {
            var job = new JObject { };
            job.Add("key", buttonObj.Key);
            job.Add("key", buttonObj.key);
            job.Add("data_type", "string");
            var valuejArray = new JArray { };
            valuejArray.Add(buttonObj.value);