wxr
2024-05-21 f30c3a80fc170109e15e75f1477263d38026436e
机械臂本地控制,安防中心成员限制
14个文件已修改
133 ■■■■ 已修改文件
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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="2.4.5" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202405201">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.4.5" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202405211">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <!--友盟-->
HDL_ON/Common/ApiUtlis.cs
@@ -72,6 +72,8 @@
        /// 下载数据完成标记
        /// </summary>
        public bool DownloadDataComplete = false;
        public bool hadInternet = true;
        /// <summary>
        /// 下载数据
        /// </summary>
@@ -97,17 +99,15 @@
            string code = StateCode.SUCCESS;
            Inverter.Ins.H5Page = null;//重置光伏页面
            bool hadInternet = true;
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                try
                {
                    //增加3秒云服务器连接检测,连不上服务器的时候不刷新数据
                    hadInternet = true;
                    var dataList = new List<GlobalRegionListRes>();
                    var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark });
                    Console.WriteLine(DateTime.Now);
                    var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost, "", 3);
                    Console.WriteLine(DateTime.Now);
                    if (revertObj == null || revertObj.Code != StateCode.SUCCESS)
                    {
                        DownloadDataComplete = true;
HDL_ON/Common/HDLCommon.cs
@@ -802,7 +802,8 @@
                    }
                    else
                    {
                        IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
                        if (result.Code != "-1")
                            IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
                    }
                }
                catch (Exception ex)
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -13,6 +13,8 @@
using HDL_ON.UI;
using HDL_ON.DAL.Server;
using HDL_ON;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace HDL_ON.DAL.Mqtt
{
@@ -159,6 +161,7 @@
        public static void InitState()
        {
            IfNeedReadAllDeviceStatus = true;
            Common.ApiUtlis.Ins.hadInternet = true;
            StartCloudMqtt();
        }
@@ -338,7 +341,13 @@
        public static async Task StartCloudMqtt()
        {
            //没有网络的状态下尝试一下连接mqtt ,安卓的网络状态变化监听有异常,修改底层麻烦
            if (MainPage.InternetStatus == 0 && MainPage.LinkHdlMqttCount > 1)
            if (MainPage.InternetStatus == 0 && MainPage.LinkHdlMqttCount > 1 )
            {
                return;
            }
            if (!Common.ApiUtlis.Ins.hadInternet)
            {
                return;
            }
@@ -364,6 +373,26 @@
            await Task.Factory.StartNew((Func<Task>)(async () => {
                try
                {
                    try
                    {
                        //增加3秒云服务器连接检测,连不上服务器的时候不刷新数据
                        var dataList = new List<GlobalRegionListRes>();
                        var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark });
                        var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost, "", 3);
                        if (revertObj == null || revertObj.Code != StateCode.SUCCESS)
                        {
                            Common.ApiUtlis.Ins.hadInternet = false;
                            return;
                        }
                        else
                        {
                            Common.ApiUtlis.Ins.hadInternet = true;
                        }
                    }
                    catch
                    {
                    }
                    #region 初始化远程Mqtt
                    RemoteMqttIsConnecting = true;
                    RemoteMqttClient = new MqttFactory().CreateMqttClient();
HDL_ON/DAL/Server/HttpUtil.cs
@@ -38,7 +38,7 @@
        /// <summary>
        /// 请求超时时间
        /// </summary>
        public const int TIME_OUT = 15;
        public const int TIME_OUT = 10;
        /// <summary>
        /// 特殊接口请求超时时间
        /// </summary>
@@ -162,6 +162,11 @@
            {
                return new ResponsePackNew() { Code = "0" ,Data = "" };
            }
            if (!Common.ApiUtlis.Ins.hadInternet)
            {
                MainPage.Log("没有外网,直接退出请求");
                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) };
            }
            #region HttpWebRequest
            try
            {
@@ -214,7 +219,7 @@
                    }
                }
                IRestResponse response = client.Execute(request);
                HDL_ON.Utlis.WriteLine("发送", requestFullUrl, response.Request.Body?.Value.ToString());
                MainPage.Log("发送:"+ requestFullUrl, response.Request.Body?.Value.ToString());
                if(apiPath == NewAPI.API_POST_Login)
                {
                    var ddd = Newtonsoft.Json.JsonConvert.SerializeObject(response);
@@ -261,14 +266,14 @@
                        }
                        catch { }
                    }
                    return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                    return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) };
                }
            }
            catch (Exception ex)
            {
                HDL_ON.Utlis.WriteLine(ex.Message);
                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR ,message = Language.StringByID(StringId.FailedRequestServer) };
            }
            #endregion
@@ -503,14 +508,14 @@
                else
                {
                    HDL_ON.Utlis.WriteLine(response.Content);
                    return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                    return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) };
                }
            }
            catch (Exception ex)
            {
                HDL_ON.Utlis.WriteLine(ex.Message);
                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR, message = Language.StringByID(StringId.FailedRequestServer) };
            }
            #endregion
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -444,7 +444,7 @@
                    SelectedImagePath = "Collection/DefenseStatusIcon.png",
                    UnSelectedImagePath = "Collection/DisarmStatusIcon.png"
                };
                if (DB_ResidenceData.Instance.GatewayType == 1)
                if (DB_ResidenceData.Instance.GatewayType == 1 && !DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
                {
                        
                    topView.AddChidren(btnSecurityStatus);
@@ -502,6 +502,10 @@
                    UnSelectedImagePath = "Collection/MsgIcon.png",
                    SelectedImagePath = "Collection/MsgIconTip.png",
                };
                if(btnSecurityStatus.Parent == null)
                {
                    btnMsgIcon.X = Application.GetRealWidth(329);
                }
                topView.AddChidren(btnMsgIcon);
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -748,7 +748,7 @@
                    case ShowFunction.SecurityMonitoring:
                        if (!MainPage.NoLoginMode)
                        {
                            if (OnAppConfig.Instance.RequestHttpsHost.Contains("bahrain"))
                            if (OnAppConfig.Instance.RequestHttpsHost.Contains("bahrain") || !Common.ApiUtlis.Ins.hadInternet)
                            {
                                functionCount = 0;
                            }
@@ -775,10 +775,16 @@
                        functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        break;
                    case ShowFunction.VideoDoorLock:
                        functionCount = FunctionList.List.GetVideoDoorLockList().Count;
                        functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.GetAttrState("status").ToString() == "open"
                            || obj.GetAttrState("status").ToString() == "normal_open").Count;
                        if (Common.ApiUtlis.Ins.hadInternet)
                        {
                            functionCount = FunctionList.List.GetVideoDoorLockList().Count;
                            functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.GetAttrState("status").ToString() == "open"
                                || obj.GetAttrState("status").ToString() == "normal_open").Count;
                        }
                        else
                        {
                            functionCount = 0;
                        }
                        break;
                    case ShowFunction.Aks:
                        functionCount = FunctionList.List.GetVideoControlsList().Count;
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -385,6 +385,16 @@
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.MechanicalArm:
                                    foreach (var f in FunctionList.List.GetMechanicalArmList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                            }
                        }
                        else
@@ -423,6 +433,14 @@
                                    }
                                    Control.Ins.SwtichFunctions(onoff == "on", eleList);
                                    break;
                                case ShowFunction.MechanicalArm:
                                    List<Function> meArmList = new List<Function>();
                                    foreach (var f in FunctionList.List.GetMechanicalArmList())
                                    {
                                        meArmList.Add(f);
                                    }
                                    Control.Ins.SwtichFunctions(onoff == "on", meArmList);
                                    break;
                            }
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -86,16 +86,18 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                    return;
                }
                //DriverLayer.Control.Ins.GatewayOnline_Cloud = false;
                //DriverLayer.Control.Ins.GatewayOnline_Local = true;
                //if (!function.isOnline())//离线不允许操作
                //{
                //    new Tip()
                //    {
                //        CloseTime = 1,
                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                //        Direction = AMPopTipDirection.None,
                //    }.Show(MainPage.BaseView);
                //    return;
                //}
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                if(SPK.NotStatusSpkList.Contains( function.spk ))
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -579,7 +579,7 @@
        /// <param name="api_Url">请求地址(不是绝对地址)</param>
        /// <param name="tag">标记->描述接口(自定义)</param>
        /// <returns></returns>
        public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag,int mTimeout = 3)
        public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag,int mTimeout = 8)
        {
            Log($"{DateTime.Now}->发送->{tag}", api_Url,o.ToString());
            var requestJson = HttpUtil.GetSignRequestJson(o);
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -727,6 +727,10 @@
        {
            btnAddIcon.MouseUpEventHandler = (sender, e) =>
            {
                if (btnSecurityTitle.IsSelected)
                {
                    return;
                }
                if (!btnAutomationTitle.IsSelected)
                {
                    //如果是成员
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs
@@ -154,7 +154,7 @@
                {
                    var dic = new Dictionary<string, string>();
                    dic.Add(FunctionAttributeKey.OnOff, statu);
                    Control.Ins.SendWriteCommand(this.device, dic, true);
                    Control.Ins.SendWriteCommand(this.device, dic);
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        this.btnPictrue.CanClick = true;
HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs
@@ -230,7 +230,7 @@
            {
                if (TipType.flicker == tipType)
                {
                    if (responsePackNew == null)
                    if (responsePackNew == null || responsePackNew.Code == "-1")
                    {
                        responsePackNew = new ResponsePackNew { message = "没回复,请确认网络是否正常.", Code = "-1", };
                    }
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -325,7 +325,7 @@
        /// <param name="api_Url">请求地址(不是绝对地址)</param>
        /// <param name="tag">标记->描述接口(自定义)</param>
        /// <returns></returns>
        public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag, int mTimeout = 15)
        public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag, int mTimeout = 10)
        {
            JObject jobject = JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(o));
            return UI2.Intelligence.Automation.Send.Current.RequestServerhomeId(jobject, api_Url, tag, mTimeout);