xm
2020-07-13 412e0af11df2b1d7986adf002e7997d82344ab3e
请合并最新版代码
8个文件已修改
10426 ■■■■ 已修改文件
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs 10146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/CommonPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120070901" android:installLocation="auto" android:versionName="1.1.0120070901">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120071301" android:installLocation="auto" android:versionName="1.1.0120071301">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" />
    <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
Diff too large
ZigbeeApp/Shared/Common/CommonPage.cs
@@ -50,7 +50,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string CodeIDString = "1.1.012070901";
        public static string CodeIDString = "1.1.012071301";
        /// <summary>
        /// 注册来源(0:HDL On 1:Zigbee)
        /// </summary>
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs
@@ -54,6 +54,10 @@
                foreach (var bDev in bList)
                {
                    var device = LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
                    if (device == null)
                    {
                        continue;
                    }
                    switch (curBindType)
                    {
                        case 0:
@@ -222,6 +226,10 @@
                foreach (var bDev in bList)
                {
                    var device = LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
                    if (device == null)
                    {
                        continue;
                    }
                    switch (curBindType)
                    {
                        case 0:
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs
@@ -732,7 +732,7 @@
                        });
                    }
                    targetList.Clear();
                    oldTargetList.Clear();
                    //选中目标列表 targetList
                    if (curControlDev.bindList.Count != 0)
                    {
@@ -901,50 +901,18 @@
                        Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
                        if (btnTipPic.IsSelected)
                        {
                            //绑定空目标必须取消按键中已经存在的目标
                            //删除情况1:绑定空目标必须取消按键中已经存在的目标
                            if (oldTargetList.Count != 0)
                            {
                                //删除取消的目标
                                //删除按键中已经绑定的目标个数【删除成功个数】
                                int sOldTargetListCount = 0;
                                foreach (var bd in oldTargetList)
                                {
                                    var delDevice = new DelDeviceBindData();
                                    delDevice.DeviceAddr = curControlDev.DeviceAddr;
                                    delDevice.Epoint = curControlDev.DeviceEpoint;
                                    var delDevice = DelBindDevice(bd);
                                    var removeDevice = new RemoveBindListObj();
                                    removeDevice.BindType = 0;
                                    switch (curDeviceBindType)
                                    {
                                        case BindInfo.BindType.FreshAir:
                                            removeDevice.BindCluster = 514;
                                            break;
                                        case BindInfo.BindType.Temperature:
                                            removeDevice.BindCluster = 1026;
                                            break;
                                        case BindInfo.BindType.Humidity:
                                            removeDevice.BindCluster = 1029;
                                            break;
                                        case BindInfo.BindType.PM:
                                            removeDevice.BindCluster = 1066;
                                            break;
                                        case BindInfo.BindType.AC:
                                            removeDevice.BindCluster = 513;//Ac需要绑定2个簇513和514
                                            break;
                                    }
                                    removeDevice.BindMacAddr = bd.DeviceAddr;
                                    removeDevice.BindEpoint = bd.DeviceEpoint;
                                    delDevice.RemoveBindList.Add(removeDevice);
                                    if (curDeviceBindType == BindInfo.BindType.AC)
                                    {
                                        //要移除空调:需要移除513,514
                                        var removeDevice3 = new RemoveBindListObj();
                                        removeDevice3.BindCluster = 514;
                                        removeDevice3.BindType = 0;
                                        removeDevice3.BindMacAddr = bd.DeviceAddr;
                                        removeDevice3.BindEpoint = bd.DeviceEpoint;
                                        delDevice.RemoveBindList.Add(removeDevice3);
                                    }
                                    //此次按键中需要移除的目标个数【同一个目标携带的多个功能删除成功的个数】
                                    int sRemoveBindListCount = 0;
                                    var delResult = new DelDeviceBindResponseAllData();
                                    delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
@@ -977,14 +945,24 @@
                                                {
                                                    if (d.Result == 0 || d.Result == 1)
                                                    {
                                                        TargesBindName();
                                                        Application.RunOnMainThread(() =>
                                                        sRemoveBindListCount++;
                                                        if (sRemoveBindListCount == delDevice.RemoveBindList.Count)
                                                        {
                                                            CommonPage.Loading.Hide();
                                                            btnFinifh.Enable = true;
                                                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                                            this.RemoveFromParent();
                                                        });
                                                            sOldTargetListCount++;
                                                        }
                                                        //按键目标中的该类型个数都删除成功
                                                        if (sOldTargetListCount == oldTargetList.Count)
                                                        {
                                                            TargesBindName();
                                                            Application.RunOnMainThread(() =>
                                                            {
                                                                CommonPage.Loading.Hide();
                                                                btnFinifh.Enable = true;
                                                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                                                this.RemoveFromParent();
                                                            });
                                                        }
                                                    }
                                                    else
                                                    {
@@ -1004,14 +982,19 @@
                                        {
                                            if (delResult.removeBindResultResponseData.Result == 0)
                                            {
                                                TargesBindName();
                                                Application.RunOnMainThread(() =>
                                                sOldTargetListCount++;
                                                //按键目标中的该类型个数都删除成功
                                                if (sOldTargetListCount == oldTargetList.Count)
                                                {
                                                    CommonPage.Loading.Hide();
                                                    btnFinifh.Enable = true;
                                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                                    this.RemoveFromParent();
                                                });
                                                    TargesBindName();
                                                    Application.RunOnMainThread(() =>
                                                    {
                                                        CommonPage.Loading.Hide();
                                                        btnFinifh.Enable = true;
                                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                                        this.RemoveFromParent();
                                                    });
                                                }
                                            }
                                            else
                                            {
@@ -1080,11 +1063,17 @@
                    {
                        Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
                        //删除按键已经存在的目标
                        //删除情况2:按键之前已经存在的目标
                        if (oldTargetList.Count != 0)
                        {
                            //删除按键中已经绑定的目标个数【删除成功个数】
                            int sOldTargetListCount = 0;
                            foreach (var bd in oldTargetList)
                            {
                                //此次按键中需要移除的目标个数【同一个目标携带的多个功能删除成功的个数】
                                int sRemoveBindListCount = 0;
                                var delDevice = DelBindDevice(bd);
                                var delResult = new DelDeviceBindResponseAllData();
                                delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
@@ -1127,91 +1116,43 @@
                                                    });
                                                    return;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (delResult != null && delResult.removeBindResultResponseData != null)
                                {
                                    if (delResult.removeBindResultResponseData.Result != 0)
                                    {
                                        Application.RunOnMainThread(() =>
                                        {
                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                            btnFinifh.Enable = true;
                                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                            CommonPage.Loading.Hide();
                                        });
                                        return;
                                    }
                                }
                            }
                        }
                        else
                        {
                            //检测已经绑定的目标是否不在本地,但是按键中有该目标,此时需要删除已经被绑定到目标,才能继续绑定新目标。以防一个按键绑定多个相同类型的目标
                            if (curBindDevice != null)
                            {
                                var delDevice = DelBindDevice(curBindDevice);
                                var delResult = new DelDeviceBindResponseAllData();
                                delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
                                if (delResult == null)
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                        CommonPage.Loading.Hide();
                                        ShowReLoadView();
                                        ReLoadAction += () =>
                                        {
                                            this.midFrameLayout.RemoveAll();
                                            //初始化设备数据
                                            CommonPage.Loading.Start("");
                                            MidFrameLayoutContent();
                                            InitData(true);
                                        };
                                    });
                                    return;
                                }
                                else
                                {
                                    if (delResult.removeBindResultResponseData == null)
                                    {
                                        if (delResult.delDeviceBindResponseData != null)
                                        {
                                            foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList)
                                            {
                                                if (d.Result != 0 && d.Result != 1)
                                                sRemoveBindListCount++;
                                                if (sRemoveBindListCount == delDevice.RemoveBindList.Count)
                                                {
                                                    Application.RunOnMainThread(() =>
                                                    {
                                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                                        btnFinifh.Enable = true;
                                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                                        CommonPage.Loading.Hide();
                                                    });
                                                    return;
                                                    sOldTargetListCount++;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (delResult != null && delResult.removeBindResultResponseData != null)
                                {
                                    if (delResult.removeBindResultResponseData.Result != 0)
                                    else
                                    {
                                        Application.RunOnMainThread(() =>
                                        if (delResult.removeBindResultResponseData.Result != 0)
                                        {
                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                            btnFinifh.Enable = true;
                                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                            CommonPage.Loading.Hide();
                                        });
                                        return;
                                            Application.RunOnMainThread(() =>
                                            {
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                                btnFinifh.Enable = true;
                                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                                CommonPage.Loading.Hide();
                                            });
                                            return;
                                        }
                                        sOldTargetListCount++;
                                    }
                                }
                            }
                            if (sOldTargetListCount != oldTargetList.Count)
                            {
                                Application.RunOnMainThread(() =>
                                {
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                    btnFinifh.Enable = true;
                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    CommonPage.Loading.Hide();
                                });
                                return;
                            }
                        }
@@ -1460,7 +1401,6 @@
                    {
                        if (device.Type == DeviceType.FreshAir)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
@@ -1471,7 +1411,6 @@
                        var bDev = device as TemperatureSensor;
                        if (bDev.SensorDiv == 1)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
@@ -1479,7 +1418,6 @@
                    {
                        if (bindDev.BindCluster == 1026)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
@@ -1490,20 +1428,17 @@
                        var bDev = device as TemperatureSensor;
                        if (bDev.SensorDiv == 2)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
                    if (device.Type == DeviceType.FreshAirHumiditySensor)
                    {
                        targetList.Add(device);
                        oldTargetList.Add(device);
                    }
                    if (device.Type == DeviceType.PMSensor)
                    {
                        if (bindDev.BindCluster == 1029)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
@@ -1513,7 +1448,6 @@
                    {
                        if (bindDev.BindCluster == 1066)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
@@ -1523,12 +1457,18 @@
                    {
                        if (bindDev.BindCluster == 513)
                        {
                            targetList.Add(device);
                            oldTargetList.Add(device);
                        }
                    }
                    break;
            }
            targetList.Clear();
            if (oldTargetList.Count != 0)
            {
                targetList.Add(oldTargetList[0]);
            }
            targetListTemp.Clear();
            foreach (var d in targetList)
            {
@@ -1588,14 +1528,26 @@
                    removeDevice.BindCluster = 1066;
                    break;
                case BindInfo.BindType.AC:
                    removeDevice.BindCluster = 513;
                    removeDevice.BindCluster = 513;//Ac需要绑定2个簇513和514
                    break;
            }
            removeDevice.BindMacAddr = bd.DeviceAddr;
            removeDevice.BindEpoint = bd.DeviceEpoint;
            delDevice.RemoveBindList.Add(removeDevice);
            if (curDeviceBindType == BindInfo.BindType.AC)
            {
                //要移除空调:需要移除513,514
                var removeDevice3 = new RemoveBindListObj();
                removeDevice3.BindCluster = 514;
                removeDevice3.BindType = 0;
                removeDevice3.BindMacAddr = bd.DeviceAddr;
                removeDevice3.BindEpoint = bd.DeviceEpoint;
                delDevice.RemoveBindList.Add(removeDevice3);
            }
            return delDevice;
        }
        #endregion
        #region 移除方法
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -101,10 +101,13 @@
            {
                //简约面板随便一个回路来获取设备信息
                var dev = Common.LocalDevice.Current.GetDevice(deviceMac, 62);
                var key = new ZigBee.Device.Panel();
                key.DeviceAddr = deviceMac;
                key.CurrentGateWayId = dev.CurrentGateWayId;
                InitBindInfo(key);
                if (dev != null)
                {
                    var key = new ZigBee.Device.Panel();
                    key.DeviceAddr = deviceMac;
                    key.CurrentGateWayId = dev.CurrentGateWayId;
                    InitBindInfo(key);
                }
            }
        }
@@ -1206,6 +1209,10 @@
                foreach (var bDev in bindList)
                {
                    var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
                    if (device == null)
                    {
                        continue;
                    }
                    if (device.Type == DeviceType.TemperatureSensor)
                    {
                        var bD = device as TemperatureSensor;
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
old mode 100755 new mode 100644
@@ -202,7 +202,10 @@
                foreach (var bDev in bindList)
                {
                    var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
                    if (device == null)
                    {
                        continue;
                    }
                    if (device.Type == DeviceType.FreshAir)
                    {
                        //获取设备类型的
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs
@@ -208,7 +208,10 @@
                    foreach (var bDev in bindList)
                    {
                        var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
                        if (device == null)
                        {
                            continue;
                        }
                        if (device.Type == DeviceType.FreshAir)
                        {
                            //获取设备类型的
@@ -284,6 +287,19 @@
                            bindAcDev = device;
                        }
                        else if (device.Type == DeviceType.PMSensor)
                        {
                            if (bDev.BindCluster == 1026)
                            {
                                bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
                                bindTemperatureDev = device;
                            }
                            if (bDev.BindCluster == 1029)
                            {
                                bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
                                bindHumidityDev = device;
                            }
                        }
                    }
                    count++;
                    if (count == 2)