wxr
2022-11-23 32a8370517ce75caac836edc82f62614d5f9b187
科技系统优化、大华摄像头功能
16个文件已修改
267 ■■■■■ 已修改文件
HDL-ON_Android/Assets/Language.ini 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/SplashActivity.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewApiRes.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini
@@ -566,6 +566,7 @@
579=Cancellation
580=Are you sure to delete this combined dimming?
581=
582=Are you sure to delete this device?
2532=Visitor Invitation Record
@@ -1796,7 +1797,7 @@
579=立即注销
580=确定删除该组合调光吗?
581=
582=确定删除该设备吗?
2532=访客邀请记录
@@ -3004,6 +3005,7 @@
579=Cancellation
580=Are you sure to delete this combined dimming?
581=
582=Are you sure to delete this device?
2532=Visitor Invitation Record
@@ -4219,6 +4221,7 @@
579=Cancellation
580=Are you sure to delete this combined dimming?
581=
582=Are you sure to delete this device?
@@ -5420,6 +5423,7 @@
579=Cancellation
580=Are you sure to delete this combined dimming?
581=
582=Are you sure to delete this device?
1000=Влажност в стаята
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.6.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211181">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.3" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211221">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <!--友盟-->
    <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
HDL-ON_Android/SplashActivity.cs
@@ -204,7 +204,7 @@
                    //}
                    //else
                    //{
                    //    Console.WriteLine("HHH 网络变化但处于后台");
                        //Console.WriteLine("HHH 网络变化但处于后台"+internetStatus);
                    //}
                    //网络变化处理
HDL_ON/Common/HDLCommon.cs
@@ -119,10 +119,13 @@
                                //}
                                mForceUpdateInfo.ReasonStr = appVersionRes.remark;
                                Application.RunOnMainThread(() =>
                                if (appVersionRes.version != MainPage.VersionString)
                                {
                                    ShowForceUpdateDialog(mForceUpdateInfo);
                                });
                                    Application.RunOnMainThread(() =>
                                    {
                                        ShowForceUpdateDialog(mForceUpdateInfo);
                                    });
                                }
                            }
                        }
                    }
@@ -622,6 +625,7 @@
        public void UpdateInternetStatus(int internetStatus, bool IsEnterBackground = false)
        {
            MainPage.Log($"网络状态变化,当前网络:{internetStatus} 是否后台:{IsEnterBackground.ToString()}");
            MainPage.LinkHdlMqttCount = 0;
            //网络状态变化 重置网关状态重新搜索
            Control.Ins.GatewayOnline_Cloud = false;
            Control.Ins.GatewayOnline_Local = false;
@@ -631,6 +635,7 @@
            if (internetStatus == 0)//没有网络连接 0
            {
                MainPage.InternetStatus = 0;
                DAL.Mqtt.MqttClient.InitState();
            }
            else if (internetStatus == 1)//3,4G的网络连接 1
            {
HDL_ON/Common/R.cs
@@ -4,6 +4,11 @@
{
    public static class StringId
    {
        /// <summary>
        /// 确定删除该设备吗?
        /// </summary>
        public const int AreYouSureToDeleteThisDevice = 582;
        /// <summary>
        /// 
        /// </summary>
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -323,10 +323,12 @@
        /// </summary>
        public static async Task StartCloudMqtt()
        {
            if (MainPage.InternetStatus == 0)
            //没有网络的状态下尝试一下连接mqtt ,安卓的网络状态变化监听有异常,修改底层麻烦
            if (MainPage.InternetStatus == 0 && MainPage.LinkHdlMqttCount > 1)
            {
                return;
            }
            MainPage.LinkHdlMqttCount++;
            if (!UserInfo.Current.IsLogin)
            {
@@ -618,6 +620,10 @@
                        {
                            IfNeedReadAllDeviceStatus = true;
                            Control.Ins.GatewayOnline_Cloud = true;
                            if(MainPage.InternetStatus == 0)
                            {
                                MainPage.InternetStatus = 1;
                            }
                            Utlis.WriteLine($"============>Mqtt远程连接成功");
                            SendPushSignOut();
                        });
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2080,6 +2080,21 @@
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
        }
        /// <summary>
        /// 删除第三方设备
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew Delete3tyDevice(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", deviceId);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
            return responsePackNew;
        }
HDL_ON/DAL/Server/NewAPI.cs
@@ -394,6 +394,10 @@
        /// </summary>
        public const string Api_Post_IndependentRegister3TyDevcie = "/home-wisdom/app/device/independentRegister";
        /// <summary>
        /// 移除第三方设备
        /// </summary>
        public const string Api_Post_Remove3tyDevcie = "/home-wisdom/app/device/remove";
        /// <summary>
        /// 获取设备详情
        /// </summary>
        public const string Api_Post_GetDevcieInfoList = "/home-wisdom/app/device/info";
HDL_ON/DAL/Server/NewApiRes.cs
@@ -1219,7 +1219,7 @@
        /// <summary>
        /// 
        /// </summary>
        public string version = MainPage.VersionString;
        public string version = "V" + MainPage.VersionString;
        ///// <summary>
        ///// 软件来源,Evoyo、ON、ON_Plus
        ///// </summary>
HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.6.2";
        public static string VersionString = "1.6.3";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
@@ -59,6 +59,10 @@
        /// </summary>
        public static int InternetStatus = 2;
        /// <summary>
        /// 连接mqtt次数
        /// </summary>
        public static int LinkHdlMqttCount = 0;
        /// <summary>
        /// 是否进入后台
        /// </summary>
        public static bool IsEnterBackground = false;
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1234,11 +1234,11 @@
            var btnLogo = new Button()
            {
                Y = Application.GetRealWidth(85),
                Y = Application.GetRealHeight(65),
                UnSelectedImagePath = "FunctionIcon/Acst/LvJianLogo.png",
                SelectedImagePath = "FunctionIcon/Acst/LvJianLogo.png",
                Width = Application.GetRealWidth(80),
                Height = Application.GetRealWidth(37),
                Height = Application.GetRealHeight(37),
            };
            view.AddChidren(btnLogo);
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
@@ -155,7 +155,7 @@
                Button btnName = new Button()
                {
                    X = Application.GetRealWidth(83),
                    Width = Application.GetRealWidth(210),
                    //Width = Application.GetRealWidth(210),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -108,12 +108,70 @@
            bool isFrist = true;
            foreach (var device in deviceList)
            {
                FrameLayout row = new FrameLayout()
                var row = new RowLayout()
                {
                    Height = Application.GetRealHeight(50),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                    LineColor = 0x00000000,
                };
                contentView.AddChidren(row);
                if(device.spk == SPK.IpCam_Imou)
                {
                    var btnDel = new Button()
                    {
                        TextColor = CSS_Color.TextualColor,
                        BackgroundColor = CSS_Color.WarningColor,
                        TextID = StringId.Del,
                        TextAlignment = TextAlignment.Center,
                    };
                    row.AddRightView(btnDel);
                    btnDel.MouseUpEventHandler = (sender, e) => {
                        Action action = () => {
                            var waitPage = new Loading();
                            this.AddChidren(waitPage);
                            waitPage.Start("");
                            new System.Threading.Thread(() =>
                            {
                                try
                                {
                                    var http = new HttpServerRequest();
                                    var result = http.Delete3tyDevice("3452daf");// device.deviceId);
                                    if (result.Code == StateCode.SUCCESS)
                                    {
                                        Application.RunOnMainThread(() =>
                                        {
                                            Load3tyBrandDeviceList();
                                        });
                                    }
                                    else
                                    {
                                        Application.RunOnMainThread(() =>
                                        {
                                            new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.OperationFailed)+$"\r\n({result.Code})", true);
                                        });
                                    }
                                }catch (Exception ex)
                                {
                                    MainPage.Log($"删除第三方设备失败:{ex.Message}");
                                }
                                finally
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        if(waitPage!= null)
                                        {
                                            waitPage.RemoveFromParent();
                                            waitPage = null;
                                        }
                                    });
                                }
                            })
                            { IsBackground = true }.Start();
                        };
                        new PublicAssmebly().TipOptionMsg(StringId.Tip, Language.StringByID(StringId.AreYouSureToDeleteThisDevice), action);
                    };
                }
                if (isFrist)
                {
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs
@@ -18,6 +18,7 @@
        VerticalScrolViewLayout contentView;
        string helloText = "上午好";
        #region 天气控件
        Button btnOutdoorTemp;
@@ -65,8 +66,45 @@
        public AcstParentPage()
        {
            basePage = this;
            var curTime = DateTime.Now;
            if (Language.CurrentLanguage != "Chinese")
            {
                helloText = "Good morning";
            }
            if (curTime.Hour >= 8 && curTime.Hour < 12)
            {
                helloText = "上午好";
                if (Language.CurrentLanguage != "Chinese")
                {
                    helloText = "Good morning";
                }
                curColor = CSS.CSS_Color.MainColor;
                imageFolder = "blue";
            }
            else if (curTime.Hour >= 12 && curTime.Hour < 18)
            {
                helloText = "下午好";
                if (Language.CurrentLanguage != "Chinese")
                {
                    helloText = "Good afternoon";
                }
                curColor = 0xFFE7914F;
                imageFolder = "orange";
            }
            else
            {
                helloText = "晚上好";
                if (Language.CurrentLanguage != "Chinese")
                {
                    helloText = "Good evening";
                }
                curColor = 0xFF9175F3;
                imageFolder = "purple";
            }
            this.function = FunctionList.List.GetAcstParentList()[0];
            this.BackgroundColor = CSS.CSS_Color.BackgroundColor;
            this.AddChidren(new Button() { Height = Application.GetRealHeight(50), BackgroundColor = curColor });
            contentView = new VerticalScrolViewLayout() {
                Height = Application.GetRealHeight(667 - 56),
            };
@@ -205,44 +243,6 @@
        public void LoadPage()
        {
            var curTime = DateTime.Now;
            string helloText = "上午好";
            if (Language.CurrentLanguage != "Chinese")
            {
                helloText = "Good morning";
            }
            if (curTime.Hour >= 8 && curTime.Hour < 12)
            {
                helloText = "上午好";
                if (Language.CurrentLanguage != "Chinese")
                {
                    helloText = "Good morning";
                }
                curColor = CSS.CSS_Color.MainColor;
                imageFolder = "blue";
            }
            else if (curTime.Hour >= 12 && curTime.Hour < 18)
            {
                helloText = "下午好";
                if (Language.CurrentLanguage != "Chinese")
                {
                    helloText = "Good afternoon";
                }
                curColor = 0xFFE7914F;
                imageFolder = "orange";
            }
            else
            {
                helloText = "晚上好";
                if (Language.CurrentLanguage != "Chinese")
                {
                    helloText = "Good evening";
                }
                curColor = 0xFF9175F3;
                imageFolder = "purple";
            }
            #region 头部信息区域
            FrameLayout topView = new FrameLayout()
            {
@@ -464,7 +464,7 @@
                    {
                        tempValues = tempValues.Remove(tempValues.IndexOf('.'), tempValues.Length - tempValues.IndexOf('.'));
                    }
                    sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "°", Language.StringByID(StringId.Temp));
                    sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "°","", Language.StringByID(StringId.Temp));
                }
                if (humiObj != null)
                {
@@ -473,19 +473,19 @@
                    {
                        humiValues = humiValues.Remove(humiValues.IndexOf('.'), humiValues.Length - humiValues.IndexOf('.'));
                    }
                    sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", Language.StringByID(StringId.Humidity));
                    sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", "", Language.StringByID(StringId.Humidity));
                }
                if (pm25Obj != null)
                {
                    sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "PM2.5");
                    sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "", "PM2.5");
                }
                if (co2Obj != null)
                {
                    sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "CO2");
                    sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "", "CO2");
                }
                if (tvocObj != null)
                {
                    sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "TVOC");
                    sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "", "TVOC");
                }
                #endregion
@@ -507,7 +507,7 @@
                    {
                        text = "Power";
                    }
                    sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "KW", text, 100);
                    sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "", "KW", text, 100);
                }
                if (dayObj != null)
                {
@@ -516,7 +516,7 @@
                    {
                        text = "Power of today";
                    }
                    sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "KWh", text, 100);
                    sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "", "KWh", text, 100);
                }
                if (monthObj != null)
                {
@@ -525,7 +525,7 @@
                    {
                        text = "Power of month";
                    }
                    sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state, "KWh", text, 100);
                    sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state, "", "KWh", text, 100);
                }
@@ -1166,7 +1166,7 @@
        public string Tag;
        public string unitString;
        public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr,string text,int setWidth = 60)
        public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr, string unitStr2, string text,int setWidth = 60)
        {
            unitString = unitStr;
            if (string.IsNullOrEmpty(value))
@@ -1191,7 +1191,7 @@
                TextAlignment = TextAlignment.Center,
                TextColor = color,
                TextSize = 20,
                Text = value,
                Text = value + unitString,
            };
            contentView.AddChidren(btnValue);
@@ -1206,9 +1206,9 @@
            };
            contentView.AddChidren(btnText);
            if(!string.IsNullOrEmpty(unitString))
            if(!string.IsNullOrEmpty(unitStr2))
            {
                btnText.Text += "(" + unitString + ")";
                btnText.Text += "(" + unitStr2 + ")";
            }
@@ -1220,7 +1220,7 @@
            {
                value = value.Remove(value.IndexOf('.'), value.Length - value.IndexOf('.'));
            }
            btnValue.Text = value;
            btnValue.Text = value + unitString;
        }
    }
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs
@@ -49,7 +49,7 @@
        /// </summary>
        public void LoadPage()
        {
            new TopViewDiv(bodyView, function.GetRoomListName()).LoadTopView();
            new TopViewDiv(bodyView, function.name).LoadTopView();
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //var contentView = new FrameLayout()
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
@@ -27,7 +27,7 @@
        public static void UpdateStatus(Function temp)
        {
            if(bodyView == null)
            if(bodyView == null || bodyView.function.sid != temp.sid)
            {
                return;
            }
@@ -43,7 +43,7 @@
                if (setTempValue != 0)
                    bodyView.btnSetTempValues.Text = setTempValue.ToString();
                bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
                //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
                //int progress = 0;
                //int.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString()), out progress);
@@ -126,32 +126,35 @@
            tempHumiView.AddChidren(tempValuesView);
            btnTempValues = new Button()
            {
                Y = Application.GetRealWidth(45),
                Height = Application.GetRealWidth(35),
                Y = Application.GetRealWidth(38),
                Height = Application.GetRealWidth(66),
                IsBold = true,
                TextSize = 30,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.TopRight,
                Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString(),"---"),
            };
            //btnTempValues.Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString());
#if __IOS__
            btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(10);
#else
            btnTempValues.Width = btnTempValues.GetTextWidth();
#endif
            btnTempValues.Gravity = Gravity.CenterHorizontal;
            tempValuesView.AddChidren(btnTempValues);
            var btnTempValuesUint = new Button()
            {
                X = btnTempValues.Right,
                Y = Application.GetRealWidth(48),
                //Y = Application.GetRealWidth(48),
                Y = Application.GetRealWidth(45),
                Height = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.TopLeft,
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                //Height = Application.GetRealWidth(30),
                TextSize = 10,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                Text = "°C"
            };
            tempValuesView.AddChidren(btnTempValuesUint);
            var humiValuesView = new FrameLayout()
            {
@@ -163,8 +166,8 @@
            tempHumiView.AddChidren(humiValuesView);
            btnHumiValues = new Button()
            {
                Y = Application.GetRealWidth(45),
                Height = Application.GetRealWidth(35),
                Y = Application.GetRealWidth(39),
                Height = Application.GetRealWidth(66),
                IsBold = true,
                TextSize = 30,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
@@ -177,10 +180,10 @@
            var btnHumiValuesUint = new Button()
            {
                X = btnTempValues.Right,
                Y = Application.GetRealWidth(48),
                Y = Application.GetRealWidth(45),
                TextAlignment = TextAlignment.TopLeft,
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(66),
                TextSize = 10,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                Text = "%"
@@ -221,15 +224,16 @@
                Text = setTempStr
            };
            contentView.AddChidren(btnSetTempValues);
            //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
#if __IOS__
            bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
#endif
            var btnSetTempUnit = new Button()
            {
                X = btnSetTempValues.Right + Application.GetRealWidth(3),
                Y = Application.GetRealHeight(267),
                Width = Application.GetRealWidth(30),
                Width = Application.GetRealWidth(50),
                Height = Application.GetRealHeight(50),
                TextSize = 23,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,