wxr
2022-05-24 967050bf6c665227823da37e04d40205c7af5a77
备份
12个文件已修改
238 ■■■■■ 已修改文件
HDL-ON_Android/Properties/AndroidManifest.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Sensor.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/WanderingAlarmPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?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="202205181">
    <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" />
<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="202205241">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <!--友盟-->
    <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
    <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
HDL-ON_iOS/Info.plist
@@ -100,9 +100,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.5.502204211</string>
    <string>1.5.502205201</string>
    <key>CFBundleVersion</key>
    <string>1.5.504211</string>
    <string>1.5.505201</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL_ON/Common/ApiUtlis.cs
@@ -159,7 +159,7 @@
                        endTime = DateTime.Now.AddSeconds(5);
                        MainPage.Log($"读取设备信息成功");
                        var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                        var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                        if (deviceList == null)
                        {
                            deviceList = new DevcieApiPack();
@@ -171,7 +171,7 @@
                                var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + "");
                                if (deviceResult2.Code == StateCode.SUCCESS)
                                {
                                    var deviceList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                                    var deviceList2 = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                                    deviceList.pageNo = deviceList2.pageNo;
                                    deviceList.list.AddRange(deviceList2.list);
                                }
HDL_ON/DAL/DriverLayer/Control.cs
@@ -94,7 +94,7 @@
            }
            set
            {
                if (_GatewayOnline_Local != value)
                //if (_GatewayOnline_Local != value)
                {
                    _GatewayOnline_Local = value;
                    if (value)
@@ -129,7 +129,7 @@
            }
            set
            {
                if (_GatewayOnline_Cloud != value)
                //if (_GatewayOnline_Cloud != value)
                {
                    _GatewayOnline_Cloud = value;
                    if(GatewayOnline_Local)
@@ -656,6 +656,79 @@
        }
        /// <summary>
        /// 发送读取命令
        /// 自动判断是否为A协议设备
        /// </summary>
        public void SendReadCommand(List<Function> functions, bool forceRemote = false)
        {
            List<string> sids = new List<string>();
            foreach (Function function in functions)
            {
                sids.Add(function.sid);
                function.refreshTime = DateTime.Now;
            }
            if (forceRemote)
            {
                var pm = new DAL.Server.HttpServerRequest();
                var pack = pm.RefreshDeviceStatus(sids);
            }
            else
            {
                if (Ins.GatewayOnline_Local)
                {
                    if (DB_ResidenceData.Instance.GatewayType == 0)
                    {
                        try
                        {
                            var busClient = new Control_Udp();
                            foreach (Function function in functions)
                            {
                                busClient.ReadBusData(function);
                            }
                        }
                        catch (Exception ex)
                        {
                            MainPage.Log($"发送数据异常: {ex.Message}");
                        }
                    }
                    else
                    {
                        var objects = new List<Dictionary<string, string>>();
                        foreach (Function function in functions)
                        {
                            var readKey = new Dictionary<string, string>();
                            readKey.Add("sid", function.sid);
                            objects.Add(readKey);
                        }
                        var readDataObj = new AlinkReadFunctionStatusObj()
                        {
                            id = Ins.msg_id.ToString(),
                            objects = objects,
                            time_stamp = Utlis.GetTimestamp()
                        };
                        var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(readDataObj);
                        var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ReadStatus, functionControlDataJson);
                        MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}");
                        new Control_Udp().SendLocalHdlLinkData(sendBytes, readDataObj.id);
                    }
                }
                else
                {
                    var pm = new DAL.Server.HttpServerRequest();
                    var pack = pm.RefreshDeviceStatus(sids);
                }
            }
        }
        /// <summary>
        /// 安防控制
        /// </summary>
        public void ControlSecurity(SecurityAlarm securityAlarm,string state)
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -1097,8 +1097,17 @@
            //创建AES解密器对象
            var cTransform = rm.CreateDecryptor();
            byte[] reData = null;
            //使用AES将密文流转成明文的字节数组
            return cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
            try
            {
                reData = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return reData;
        }
        #endregion
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -117,6 +117,7 @@
            if (mHDLSipInfo == null) return;
#if __IOS__
            //Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login("1003", "123456", "192.168.31.194:5060");
            //Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login("6666", "85521566", "116.62.26.215:5060");
            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm);
#else
HDL_ON/Entity/Function/Sensor.cs
@@ -65,7 +65,7 @@
                }
            }
            double value = 0.0;
            double.TryParse( attr.state,out value);
            double.TryParse(attr.state, out value);
            return Convert.ToDouble(value);
        }
@@ -150,7 +150,7 @@
            return _intervalValue;
        }
        public string Unit(Function  function)
        public string Unit(Function function)
        {
            string unit = "";
@@ -173,7 +173,7 @@
                    unit = "ug/m²";
                    break;
                case SPK.SensorTemperature:
                    unit =  "°C";
                    unit = "°C";
                    break;
                case SPK.SensorTVOC:
                    unit = "PPB";
@@ -338,6 +338,69 @@
            }
            return _levelTextList;
        }
        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="function"></param>
        /// <returns></returns>
        public uint GetCurColor(Function function)
        {
            var spk = function.spk;
            var values = GetValues(function);
            uint level = 0x00000000;
            if (function.attrKeyConfigs.Count > 0)
            {
                foreach (var attrKey in function.attrKeyConfigs)
                {
                    if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", "")))
                    {
                        foreach (var info in attrKey.configs)
                        {
                            if ((Convert.ToInt32(info.start) >= values) && (Convert.ToInt32(info.end) < values))
                            {
                                return Convert.ToUInt32(info.color, 16);
                            }
                        }
                    }
                }
            }
            return level;
        }
        /// <summary>
        /// 获取文本
        /// </summary>
        /// <param name="function"></param>
        /// <returns></returns>
        public string GetCurText(Function function)
        {
            var spk = function.spk;
            var values = GetValues(function);
            var level = "";
            if (function.attrKeyConfigs.Count > 0)
            {
                foreach (var attrKey in function.attrKeyConfigs)
                {
                    if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", "")))
                    {
                        foreach (var info in attrKey.configs)
                        {
                            if ((Convert.ToInt32(info.start) >= values) && (Convert.ToInt32(info.end) < values))
                            {
                                return info.desc;
                            }
                        }
                    }
                }
            }
            return level;
        }
        /// <summary>
        /// 当前等级
        /// </summary>
@@ -346,6 +409,37 @@
            var spk = function.spk;
            var values = GetValues(function);
            int level = 1;
            if (function.attrKeyConfigs.Count > 0)
            {
                foreach (var attrKey in function.attrKeyConfigs)
                {
                    if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", "")))
                    {
                        level = 1;
                        if(attrKey.configs.Count == 0)
                        {
                            break;
                        }
                        foreach (var info in attrKey.configs)
                        {
                            if ((Convert.ToDouble(info.start) < values) && (Convert.ToDouble(info.end) >= values))
                            {
                                return level;
                            }
                            level++;
                        }
                    }
                }
                    return 1;
            }
            switch (spk)
            {
                case SPK.SensorPm25:
HDL_ON/Entity/FunctionList.cs
@@ -468,12 +468,25 @@
                    if(DriverLayer.Control.Ins.GatewayOnline_Local)
                    {
                        //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl);
                        //var sss = functions.OrderBy((obj) => obj.collect);
                        List<Function> readList = new List<Function>();
                        foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl))
                        {
                            readList.Add(function);
                            MainPage.Log($"读取功能状态:{function.name} : {function.sid} ");
                            Control.Ins.SendReadCommand(function);
                            if (readList.Count > 9)
                            {
                                Control.Ins.SendReadCommand(readList);
                            }
                        }
                        if(DB_ResidenceData.Instance.GatewayType == 1)
                        if (readList.Count > 0)
                        {
                            Control.Ins.SendReadCommand(readList);
                        }
                        if (DB_ResidenceData.Instance.GatewayType == 1)
                        {
                            Dictionary<string, string> pairs = new Dictionary<string, string>();
                            string sendId = Control.Ins.msg_id.ToString();
@@ -490,6 +503,8 @@
                        var page = new List<string>();
                        int count = 0;
                        //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl);
                        //var sss = functions.OrderBy((obj) => obj.collect);
                        foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl))
                        {
                            page.Add(function.deviceId);
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -217,7 +217,7 @@
                    //etAccount.Text = "18316120654";//tujie
                    //etAccount.Text = "13450425807";//黄竹溪 knx项目
                    etAccount.Text = "18244942707";
                    etAccount.Text = "13826414433";//陈伟潮 自研可视对讲
                    etAccount.Text = "3083375423@qq.com";//陈伟潮 自研可视对讲
                }
                else
                {
@@ -245,6 +245,7 @@
                    //etAccount.Text = "info@smartlife-ks.com";
                    //etAccount.Text = "551775569@qq.com";//wcf
                    //etAccount.Text = "15626203746";
                    etAccount.Text = "18244942707";
                    //etAccount.Text = "zhangquansongjava@163.com";
                    //etAccount.Text = "s.savinov@hdlautomation.ru";
                }
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -155,7 +155,11 @@
                function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
                d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                if (dimmerBar.Progress > 0)
                {
                    d.Add(FunctionAttributeKey.OnOff, "on");
                }
                Control.Ins.SendWriteCommand(function, d);
                //function.fadeTime = barFadeTime.Progress;
                btnBrightnessText.Text = dimmerBar.Progress + "%";
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -93,6 +93,7 @@
                dimmerBar.OnStartTrackingTouchEvent = (sender, e) =>
                {
                    onDimmerBar = true;
                    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                };
                dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
                {
@@ -100,13 +101,17 @@
                    function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
                    if(dimmerBar.Progress > 0)
                    {
                        d.Add(FunctionAttributeKey.OnOff, "on");
                    }
                    Control.Ins.SendWriteCommand(function, d);
                    btnBrightnessText.Text = dimmerBar.Progress + "%";
                };
                //20201223 删除滑动发送命令,防止控件跳动
                dimmerBar.OnProgressChangedEvent = (sender, e) =>
                {
                    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //function.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
HDL_ON/UI/UI2/FuntionControlView/Video/WanderingAlarmPage.cs
@@ -171,7 +171,7 @@
                        };
                    });
                    System.Threading.Thread.Sleep(50);
                    System.Threading.Thread.Sleep(20);
                }
                Application.RunOnMainThread(() =>