wei
2021-11-04 e238b9cc3caef879fd907ceab8997d08ae891ea3
BUG修复

1.场景增加插座功能
2.rgb配合zb调整
3.场景控制只发送一次。
9个文件已修改
154 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,39 +1,34 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/MainPage.cs">
    <Files>
      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="12" Column="26" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs" Line="100" Column="16" />
      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="21" Column="87" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="1142" Column="38" />
      <File FileName="HDL_ON/UI/UI2/UserPage.cs" Line="1" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="880" Column="6" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" Line="1575" Column="25" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="832" Column="30" />
      <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="224" Column="50" />
      <File FileName="HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs" Line="79" Column="30" />
      <File FileName="HDL_ON/UI/MainPage.cs" Line="111" 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="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="DriverLayer" expanded="True" />
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="ResponseEntity" expanded="True" />
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="3-Intelligence" expanded="True">
                    <Node name="Automation" expanded="True">
                      <Node name="LogicView" expanded="True">
                        <Node name="TopView.cs" selected="True" />
                      </Node>
                    </Node>
                  </Node>
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="Curtain" expanded="True" />
                    <Node name="FoolHeating" expanded="True" />
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True" />
                </Node>
                <Node name="MainPage.cs" selected="True" />
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True" />
@@ -53,8 +48,8 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="1415" column="1" />
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202110281" android:versionName="1.2.202110281" package="com.hdl.onpro">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202111031" android:versionName="1.3.202111031" package="com.hdl.onpro">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
    <!-- 乐橙可视对讲需要的权限 -->
    <!--<uses-permission android:name="android.permission.INTERNET" />-->
HDL_ON/DAL/DriverLayer/Control.cs
@@ -38,6 +38,11 @@
                return _control;
            }
        }
        /// <summary>
        /// 记录接收到的消息,方便zb的工程师调试他们的设备
        /// </summary>
        public List<string> MsgInfoList = new List<string>();
        int _msg_id = 1;
        /// <summary>
        /// 通讯ID
@@ -354,7 +359,7 @@
        /// <param name="function"></param>
        /// <param name="useRemote">是否直接使用远程发送</param>
        /// <returns></returns>
        public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false)
        public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3)
        {
            function.controlCounter++;
            function.refreshTime = DateTime.Now;
@@ -451,7 +456,7 @@
                        var functionControlDataObj = function.GetGatewayAlinkControlData(commandDictionary);
                        var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
                        var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson);
                        new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id);
                        new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id,resend);
                        MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}");
                    }
                }
@@ -699,7 +704,7 @@
                };
                var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData);
                var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlScene, aLinkJson);
                new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id);
                new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id,0);
            }
        }
        /// <summary>
@@ -830,6 +835,10 @@
                            var revString = Encoding.UTF8.GetString(receiveBytes);
                            receiveObj.BodyDataString = revString;
                            MainPage.Log($"局域网信息: 解密后:" + receiveObj.BodyDataString);
                            if(receiveObj.Topic.EndsWith("/thing/property/up"))
                            {
                                MsgInfoList.Add(revString + "\r\n");
                            }
                        }
                        else
                        {
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -1133,17 +1133,18 @@
        /// <summary>
        /// 发送udp A协议数据
        /// </summary>
        public void SendLocalHdlLinkData(byte[] sendBytes,string id, bool isWait=false)
        public void SendLocalHdlLinkData(byte[] sendBytes,string id, int resend = 3)
        {
            packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse(Control.Ins.reportIp), 8585));
            packet.HaveSendCount = 3 - resend;//重发次数
            sendFlag = id;
            System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount));
            thread.IsBackground = true;
            thread.Start(packet);
            if (isWait)
            {
                wait();
            }
            //if (isWait)
            //{
            //    wait();
            //}
            MainPage.Log($"发送Hdl-Link数据,IP:{Control.Ins.reportIp}:8585");
        }
    }
HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        /// <summary>
        /// RegionMark
        /// </summary>
HDL_ON/UI/MainPage.cs
@@ -25,7 +25,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.2.1028";
        public static string VersionString = "1.3.1103";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
@@ -109,6 +109,7 @@
            SPK.FloorHeatStandard,SPK.HvacFloorHeat,
            SPK.AirFreshStandard,SPK.HvacAirFresh,
            SPK.AirSwitch,
            SPK.PanelSocket,SPK.ElectricSocket,
        };
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -1,6 +1,7 @@
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.Entity;
using HDL_ON.DriverLayer;
namespace HDL_ON.UI
{
@@ -850,11 +851,55 @@
            #endregion
            #region 获取支持
            //FrameLayout supView = new FrameLayout()
            //{
            //    Height = Application.GetRealWidth(44),
            //};
            //supportView.AddChidren(supView);
            FrameLayout supView = new FrameLayout()
            {
                Height = Application.GetRealWidth(44),
                BackgroundColor = 0xFFFF0000,
            };
            supportView.AddChidren(supView);
            supView.MouseUpEventHandler = (sender, e) => {
                Dialog dialog = new Dialog();
                var bodyView = new FrameLayout();
                dialog.AddChidren(bodyView);
                var contentView = new VerticalScrolViewLayout()
                {
                    Height = Application.GetRealHeight(600),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                bodyView.AddChidren(contentView);
                var btnClose = new Button()
                {
                    Y = Application.GetRealHeight(600),
                    Height = Application.GetRealHeight(67),
                    BackgroundColor = CSS_Color.WarningColor,
                    Text = "关 闭",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                };
                btnClose.MouseUpEventHandler = (sender, e) => {
                    dialog.Close();
                };
                bodyView.AddChidren(btnClose);
                foreach (var msg in Control.Ins.MsgInfoList)
                {
                    var et = new TextView()
                    {
                        IsMoreLines = true,
                        Height = Application.GetRealHeight(150),
                        Width = Application.GetRealWidth(300),
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.TextFontSize,
                        Text = msg,
                    };
                    contentView.AddChidren(et);
                }
                dialog.Show();
            };
            //Button btnSupportIcon = new Button()
            //{
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -66,6 +66,19 @@
        public override void InitFrameWhiteContent()
        {
            var sk = device.GetAttribute(FunctionAttributeKey.SetTemp);
            if (sk != null)
            {
                if (sk.min == 0)
                {
                    sk.min = 16;
                }
                if (sk.max == 0)
                {
                    sk.max = 32;
                }
            }
            base.ShowColltionButton = false;
            base.SetTitleText(Language.StringByID(StringId.Electric));
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -89,6 +89,7 @@
        void LoadColorChangeEvent()
        {
            DateTime colorChangeTime = DateTime.MinValue;
            //bool send = false;
            //当前点击的【点】是否正确
            bool pointIsRight = false;
@@ -101,8 +102,17 @@
                    //pointIsRight:点的区域不是圆盘内
                    return;
                }
                lastColor = e2;
                //if (send)
                //{
                    lastColor = e2;
                //    send = false;
                //}
            };
            //colorPicker.MouseUpEventHandler += (sender, e) => {
            //    send = true;
            //};
            colorPicker.MouseDownEventHandler += (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
@@ -165,7 +175,7 @@
                            lightTemp.SetRGBcolor(lastColor, function);
                            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                            d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function));
                            Control.Ins.SendWriteCommand(function, d);
                            Control.Ins.SendWriteCommand(function, d,false,0);
                            break;
                        }
                    }