wxr
2022-06-10 b4ee7bafc83d9b0b5b7d3cc7c369bd39f796eba5
代码备份
2个文件已添加
13个文件已修改
248 ■■■■■ 已修改文件
HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIconGray.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/FloorHeating.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SiriIntents/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIconGray.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -243,6 +243,8 @@
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Panel\PanelHelpNormalBgIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\screenpanel.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Panel\PanelEnviBg.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\FloorHeating\EconomicIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\FloorHeating\EconomicIconGray.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\values\colors.xml" />
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:versionName="1.5.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202206011">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202206082">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <!--友盟-->
    <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
HDL_ON/DAL/DriverLayer/Control.cs
@@ -280,7 +280,8 @@
                        }
                        if (DB_ResidenceData.Instance.GatewayType == 0)
                        {
                            new Control_Udp().ControlBytesSend(Command.ReadGateway, 255, 255, new byte[] { (byte)new Random().Next(255), (byte)new Random().Next(255) });
                            new Control_Udp().ControlBytesSend(Command.ReadGateway, 255, 255,
                                new byte[] { (byte)new Random().Next(255), (byte)new Random().Next(255) });
                        }
                        else if (DB_ResidenceData.Instance.GatewayType == 1)
                        {
@@ -1051,9 +1052,6 @@
                                }
                            }
                        }
                        var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
                        if (localFunction == null)
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -162,7 +162,6 @@
        /// <summary>
        /// 控制bus场景
        /// todo
        /// </summary>
        public void ControlBusScenes(Scene scene)
        {
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -111,7 +111,6 @@
        /// <summary>
        /// 数据包处理
        /// ps:由commonpage转移过来,还需要转移合适的位置管理
        /// </summary>
        /// <param name="subnetID"></param>
        /// <param name="deviceID"></param>
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -483,7 +483,8 @@
                                    {
                                        try
                                        {
                                            var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey);
                                            var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload,
                                                DB_ResidenceData.Instance.HomeGateway.aesKey);
                                            var securityString = Encoding.UTF8.GetString(securityBytes);
                                            var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString);
                                            MainPage.Log($"安防状态变化:{securityString}");
@@ -519,7 +520,6 @@
                                    MainPage.Log($"mqtt 状态更新:{revString}");
                                    Control.Ins.UpdataFunctionStatus(revString, null, true);
                                    //Control.Ins.MsgInfoList.Add($"mqtt 状态更新:{revString}");
                                    //Control.Ins.MsgInfoList.Add(revString + "\r\n");
                                }
                                //一端口数据解析
@@ -532,7 +532,8 @@
                                    if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey))
                                    {
                                        packet.Bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey);
                                        packet.Bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload,
                                            DB_ResidenceData.Instance.HomeGateway.aesKey);
                                    }
                                    else
                                    {
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/Entity/Function/FloorHeating.cs
@@ -150,6 +150,26 @@
        /// </summary>
        public byte timeFlag = 0;
        public string GetWrokModeIconPath(string value, bool lighting = true)
        {
            var imagePath = "FunctionIcon/AC/HeatingIcon.png";
            switch (value)
            {
                case "heat":
                    imagePath = lighting ? "FunctionIcon/AC/HeatingIcon.png" : "FunctionIcon/AC/HeatingIconGray.png";
                    break;
                case "cool":
                    imagePath = lighting ? "FunctionIcon/AC/CoolIcon.png" : "FunctionIcon/AC/CoolIconGray.png";
                    break;
                case "economic":
                    imagePath = lighting ? "FunctionIcon/FloorHeating/EconomicIcon.png" : "FunctionIcon/FloorHeating/EconomicIconGray.png";
                    break;
            }
            return imagePath;
        }
        /// <summary>
        /// 获取模式的icon路径
        /// <param name="lightingIcon">获取的图标类型,默认是点亮</param>
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -630,7 +630,7 @@
                functionTypeList.Add(SPK.ElectricSocket);
                functionTypeList.Add(SPK.HvacCac);
                functionTypeList.Add(SPK.SensorHelp);
                functionTypeList.Add(SPK.DoorLock);
            }
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -36,6 +36,11 @@
        /// </summary>
        Button btnMode;
        /// <summary>
        /// 工作模式按钮
        /// </summary>
        Button btnWrokMode;
        /// <summary>
        /// 开关按钮
        /// </summary>
        Button btnSwitch;
@@ -172,6 +177,25 @@
            };
            FrameWhiteCentet1.AddChidren(btnPlus);
            if (device.GetAttribute("mode_work") != null)
            {
                btnWrokMode = new Button()
                {
                    X = Application.GetRealWidth(60),
                    Y = Application.GetRealHeight(334),
                    Width = Application.GetRealWidth(30),
                    Height = Application.GetRealWidth(30),
                    UnSelectedImagePath = fhTemp.GetWrokModeIconPath(device.GetAttrState("mode_work")),
                };
                FrameWhiteCentet1.AddChidren(btnWrokMode);
                if (device.GetAttribute("mode_work").value.Count > 1)
                {
                    btnMode.MouseUpEventHandler = (sender, e) =>
                    {
                        LoadDiv_ChangeModeView();
                    };
                }
            }
            if (device.GetAttribute(FunctionAttributeKey.Mode) != null)
            {
                btnMode = new Button()
@@ -208,6 +232,135 @@
            LoadEvent_AcStatesChange();
        }
        /// <summary>
        /// 加载修改模式区域
        /// </summary>
        void LoadDiv_ChangeWorkModeView()
        {
            Dialog dialog = new Dialog();
            FrameLayout dialogView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            dialog.AddChidren(dialogView);
            FrameLayout modeChangeView;
            modeChangeView = new FrameLayout()
            {
                X = Application.GetRealWidth(30),
                Y = Application.GetRealHeight(128),
                Width = Application.GetRealWidth(160),
                Height = Application.GetRealHeight(287),
                BackgroundImagePath = "FunctionIcon/AC/DivBg1.png",
            };
            dialogView.AddChidren(modeChangeView);
            Button btnTitle;
            btnTitle = new Button()
            {
                X = Application.GetRealWidth(8 + 16),
                Y = Application.GetRealHeight(8),
                Width = Application.GetRealWidth(112),
                Height = Application.GetRealHeight(44),
                TextID = StringId.ChooseMode,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
            };
            modeChangeView.AddChidren(btnTitle);
            Button btnLine = new Button()
            {
                X = btnTitle.X,
                Y = btnTitle.Bottom,
                Width = Application.GetRealWidth(112),
                Height = Application.GetRealHeight(1),
                BackgroundColor = CSS_Color.BackgroundColor,
            };
            modeChangeView.AddChidren(btnLine);
            var modeList = device.GetAttribute(FunctionAttributeKey.WorkMode).value;
            foreach (var m in modeList)
            {
                Button btnModeIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = device.GetAttrState(FunctionAttributeKey.WorkMode) == m,
                };
                modeChangeView.AddChidren(btnModeIcon);
                Button btnModeText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnModeIcon.Right,
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(90),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                modeChangeView.AddChidren(btnModeText);
                btnModeIcon.UnSelectedImagePath = fhTemp.GetModeIconPath(m, false);
                btnModeIcon.SelectedImagePath = fhTemp.GetModeIconPath(m);
                btnModeText.Text = fhTemp.GetModeAttrText(m);
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {
                        X = btnTitle.X,
                        Y = btnModeText.Bottom,
                        Width = Application.GetRealWidth(112),
                        Height = Application.GetRealHeight(1),
                        BackgroundColor = CSS_Color.BackgroundColor,
                    });
                }
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    dialog.Close();
                };
                EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                {
                    //if (!device.online)
                    //{
                    //    new Tip()
                    //    {
                    //        CloseTime = 1,
                    //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                    //        Direction = AMPopTipDirection.None,
                    //    }.Show(MainPage.BaseView);
                    //}
                    btnModeIcon.IsSelected = btnModeText.IsSelected = true;
                    device.SetAttrState(FunctionAttributeKey.WorkMode, m);
                    btnMode.UnSelectedImagePath = fhTemp.GetWrokModeIconPath(m);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath;
                    d.Add(FunctionAttributeKey.WorkMode, m);
                    Control.Ins.SendWriteCommand(device, d);
                    dialog.Close();
                };
                btnModeIcon.MouseUpEventHandler = eventHandler1;
                btnModeText.MouseUpEventHandler = eventHandler1;
                dialogView.MouseUpEventHandler = eventHandler;
            }
            dialogView.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            dialog.Show();
        }
        /// <summary>
        /// 加载修改模式区域
@@ -525,6 +678,15 @@
                    arcBar.IsClickable = false;
                    arcBar.IsOffline = true;
                }
                if(btnWrokMode!=null){
                    var dd = device.GetAttrState("mode_work");
                    if (dd != "0")
                    {
                        btnWrokMode.UnSelectedImagePath = fhTemp.GetWrokModeIconPath(dd);
                    }
                }
            });
        }
HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using HDL_ON.Common;
using HDL_ON.DAL.Server;
using Shared;
namespace HDL_ON.UI
@@ -79,7 +81,37 @@
                function.roomIds.Remove(room.roomId);
                //room.RemoveRoomFunction(function);
            }
            function.UpdataRoomIds();
            //function.UpdataRoomIds();
            new System.Threading.Thread(() =>
            {
                try
                {
                    var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(function);
                    //直接保存本地,
                    function.SaveFunctionFile();
                    if (pack.Code == StateCode.SUCCESS)
                    {
                        if (UI.RoomPage.bodyView != null)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                UI.RoomPage.bodyView.ReLoadPage();
                            });
                        }
                    }
                    else
                    {
                        IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                    }
                }
                catch (Exception ex){
                    MainPage.Log("房间绑定设备异常" + ex.Message);
                }
            })
            { IsBackground = true }.Start();
            if (function.roomIds.Count == Entity.SpatialInfo.CurrentSpatial.RoomList.Count)
            {
                btnChooseAll.IsSelected = true;
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using Shared;
@@ -76,7 +77,7 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,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>